Skip to content

Commit

Permalink
Add in detection for screen
Browse files Browse the repository at this point in the history
I did this a while ago, and it seems to be in a branch on two machines, but
not in main and not actually in the repo, for some odd reason.

Either way, this seems worth having...
  • Loading branch information
davep committed Oct 9, 2023
1 parent 45f8f12 commit 4e11bb3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/textual_dev/tools/diagnose.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,17 @@ def _guess_term() -> str:
if term_version is not None:
term_program = f"{term_program} ({term_version})"

return "*Unknown*" if term_program is None else term_program
# Seems we can't work this out.
if term_program is None:
term_program = "*Unknown*"

# Check for running under screen. As you look at this you might think
# "what about tmux too?" -- good point; but we'll be picking up tmux as
# the terminal type, because of how it takes over TERM_PROGRAM.
if "STY" in os.environ:
term_program += " (inside screen)"

return term_program


def _env(var_name: str) -> str:
Expand Down

0 comments on commit 4e11bb3

Please sign in to comment.