Terminal: support kgx (gnome console)

Fix #577
This commit is contained in:
李通洲
2023-10-08 09:24:13 +08:00
committed by 李通洲
parent 276e22f6b0
commit e4a6bf17e4
3 changed files with 41 additions and 2 deletions
@@ -206,6 +206,20 @@ FF_MAYBE_UNUSED static bool getTerminalVersionGnome(FFstrbuf* version)
return true;
}
FF_MAYBE_UNUSED static bool getTerminalVersionKgx(FFstrbuf* version)
{
if(ffProcessAppendStdOut(version, (char* const[]){
"gnome-terminal",
"--version",
NULL
})) return false;
//# KGX 45.0 using VTE 0.74.0 +BIDI +GNUTLS +ICU +SYSTEMD
ffStrbufSubstrAfterFirstS(version, "KGX ");
ffStrbufSubstrBeforeFirstC(version, ' ');
return true;
}
FF_MAYBE_UNUSED static bool getTerminalVersionKonsole(FFstrbuf* exe, FFstrbuf* version)
{
const char* konsoleVersion = getenv("KONSOLE_VERSION");
@@ -385,7 +385,9 @@ const FFTerminalShellResult* ffDetectTerminalShell()
#elif defined(__linux__) || defined(__FreeBSD__)
else if(ffStrbufStartsWithS(&result.terminalProcessName, "gnome-terminal-"))
ffStrbufInitStatic(&result.terminalPrettyName, "gnome-terminal");
ffStrbufInitStatic(&result.terminalPrettyName, "GNOME Terminal");
else if(ffStrbufStartsWithS(&result.terminalProcessName, "kgx"))
ffStrbufInitStatic(&result.terminalPrettyName, "GNOME Console");
#elif defined(__APPLE__)