1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-28 03:06:20 -04:00

[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

View File

@ -349,9 +349,16 @@ is_xterm(void)
* In general, proper xterm detection is a nightmarish task... * In general, proper xterm detection is a nightmarish task...
* *
* -- Adam Borowski <kilobyte@mimuw.edu.pl> */ * -- 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; return xt;