File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,8 +66,8 @@ def _guess_term() -> str:
6666 The best guess at the name of the terminal.
6767 """
6868
69- # First obvious place to look is in $TERM_PROGRAM .
70- term_program = os .environ .get ("TERM_PROGRAM" )
69+ # Look in a couple of generic locations for the name of the terminal .
70+ term_program = os .environ .get ("TERM_PROGRAM" ) or os . environ . get ( "TERMINAL_NAME" )
7171
7272 if term_program is None :
7373 # Seems we couldn't get it that way. Let's check for some of the
@@ -87,7 +87,9 @@ def _guess_term() -> str:
8787
8888 else :
8989 # See if we can pull out some sort of version information too.
90- term_version = os .environ .get ("TERM_PROGRAM_VERSION" )
90+ term_version = os .environ .get ("TERM_PROGRAM_VERSION" ) or os .environ .get (
91+ "TERMINAL_VERSION_STRING"
92+ )
9193 if term_version is not None :
9294 term_program = f"{ term_program } ({ term_version } )"
9395
You can’t perform that action at this time.
0 commit comments