1
0
Fork 0

[xterm] If TERM environment variable starts with "xterm", then it is xterm.

For ssh sessions.
This commit is contained in:
Witold Filipczyk 2022-12-17 10:31:42 +01:00
parent 2cb2da87f2
commit 25515d707a
1 changed files with 9 additions and 2 deletions

View File

@ -349,9 +349,16 @@ is_xterm(void)
* In general, proper xterm detection is a nightmarish task...
*
* -- Adam Borowski <kilobyte@mimuw.edu.pl> */
char *display = getenv("DISPLAY");
xt = (display && *display && check_more_envs());
char *term = getenv("TERM");
if (term && !strncmp("xterm", term, 5)) {
xt = 1;
} else {
char *display = getenv("DISPLAY");
xt = (display && *display && check_more_envs());
}
}
return xt;