TerminalFont (Linux): improve detection for xterm

Fix #1095
This commit is contained in:
李通洲
2024-07-15 10:05:35 +08:00
committed by Carter Li
parent beabaa90f1
commit 7eaefe163a
3 changed files with 20 additions and 14 deletions
+9 -5
View File
@@ -352,11 +352,15 @@ FF_MAYBE_UNUSED static bool getTerminalVersionCockpit(FFstrbuf* exe, FFstrbuf* v
FF_MAYBE_UNUSED static bool getTerminalVersionXterm(FFstrbuf* exe, FFstrbuf* version)
{
if(ffProcessAppendStdOut(version, (char* const[]){
exe->chars,
"-v",
NULL
})) return false;
ffStrbufSetS(version, getenv("XTERM_VERSION"));
if (!version->length)
{
if(ffProcessAppendStdOut(version, (char* const[]){
exe->chars,
"-v",
NULL
})) return false;
}
//xterm(273)
ffStrbufTrimRight(version, ')');