1
0
Fork 0

[terminal] Detect gnome-terminal as x-terminal. Refs #35

This commit is contained in:
Witold Filipczyk 2019-08-24 10:28:01 +02:00
parent a53486b31d
commit 5115a3225d
1 changed files with 23 additions and 4 deletions

View File

@ -290,6 +290,28 @@ is_gnuscreen(void)
#if defined(CONFIG_OS_UNIX) || defined(CONFIG_OS_WIN32)
static int
check_more_envs(void)
{
unsigned char *envs[] = { "WINDOWID",
"KONSOLE_DCOP_SESSION",
"GNOME_TERMINAL_SERVICE",
NULL
};
unsigned char **v;
for (v = envs; *v; ++v)
{
unsigned char *value = getenv(*v);
if (value && *value) {
return 1;
}
}
return 0;
}
int
is_xterm(void)
{
@ -315,11 +337,8 @@ is_xterm(void)
*
* -- Adam Borowski <kilobyte@mimuw.edu.pl> */
unsigned char *display = getenv("DISPLAY");
unsigned char *windowid = getenv("WINDOWID");
if (!windowid || !*windowid)
windowid = getenv("KONSOLE_DCOP_SESSION");
xt = (display && *display && windowid && *windowid);
xt = (display && *display && check_more_envs());
}
return xt;