Skip to content

Commit ccb227e

Browse files
committed
TerminalShell: fix iTerm being detected as iTermServer-* sometimes
1 parent 9c7b868 commit ccb227e

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Features:
66
Bugfixes:
77
* Fix flatpak package count (#441)
88
* Don't print white color blocks with `--pipe` (#450)
9+
* Fix iTerm being detected as iTermServer-* sometimes
910

1011
Logo:
1112
* Update Windows 11 ASCII logo to look more visually consistent (#445)

src/detection/terminalfont/terminalfont_apple.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ static void detectWarpTerminal(const FFinstance* instance, FFTerminalFontResult*
8686

8787
void ffDetectTerminalFontPlatform(const FFinstance* instance, const FFTerminalShellResult* terminalShell, FFTerminalFontResult* terminalFont)
8888
{
89-
if(ffStrbufIgnCaseCompS(&terminalShell->terminalProcessName, "iterm.app") == 0)
89+
if(ffStrbufIgnCaseCompS(&terminalShell->terminalProcessName, "iterm.app") == 0 ||
90+
ffStrbufStartsWithIgnCaseS(&terminalShell->terminalProcessName, "iTermServer-"))
9091
detectIterm2(instance, terminalFont);
9192
else if(ffStrbufIgnCaseCompS(&terminalShell->terminalProcessName, "Apple_Terminal") == 0)
9293
detectAppleTerminal(terminalFont);

src/detection/terminalshell/terminalshell.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe
291291
if(termProgram)
292292
{
293293
if(ffStrbufStartsWithIgnCaseS(processName, termProgram) || // processName ends with `.exe` on Windows
294-
(strcmp(termProgram, "vscode") == 0 && ffStrbufStartsWithIgnCaseS(processName, "code"))
294+
(strcmp(termProgram, "vscode") == 0 && ffStrbufStartsWithIgnCaseS(processName, "code")) ||
295+
(strcmp(termProgram, "iTerm.app") == 0 && ffStrbufStartsWithIgnCaseS(processName, "iTermServer-"))
295296
) {
296297
ffStrbufSetS(version, termProgramVersion);
297298
return true;

src/detection/terminalshell/terminalshell_linux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ const FFTerminalShellResult* ffDetectTerminalShell(const FFinstance* instance)
378378
ffStrbufInitS(&result.shellPrettyName, result.shellExeName);
379379
}
380380

381-
if(ffStrbufEqualS(&result.terminalProcessName, "iTerm.app"))
381+
if(ffStrbufEqualS(&result.terminalProcessName, "iTerm.app") || ffStrbufStartsWithS(&result.terminalProcessName, "iTermServer-"))
382382
ffStrbufInitS(&result.terminalPrettyName, "iTerm");
383383
else if(ffStrbufEqualS(&result.terminalProcessName, "Apple_Terminal"))
384384
ffStrbufInitS(&result.terminalPrettyName, "Apple Terminal");

0 commit comments

Comments
 (0)