Skip to content

Commit 4bd4ec2

Browse files
committed
Terminal (Linux): detect zellij version
1 parent fc685e9 commit 4bd4ec2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/detection/terminalshell/terminalshell.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,15 @@ static bool getTerminalVersionTmux(FFstrbuf* exe, FFstrbuf* version)
437437
return version->length > 0;
438438
}
439439

440+
static bool getTerminalVersionZellij(FFstrbuf* exe, FFstrbuf* version)
441+
{
442+
if(!getExeVersionRaw(exe, version)) return false;
443+
444+
// zellij 0.39.2
445+
ffStrbufSubstrAfterFirstC(version, ' ');
446+
return version->length > 0;
447+
}
448+
440449
#ifdef _WIN32
441450

442451
static bool getTerminalVersionWindowsTerminal(FFstrbuf* exe, FFstrbuf* version)
@@ -554,6 +563,9 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe
554563
if(ffStrbufStartsWithIgnCaseS(processName, "screen"))
555564
return getTerminalVersionScreen(exe, version);
556565

566+
if(ffStrbufStartsWithIgnCaseS(processName, "zellij"))
567+
return getTerminalVersionZellij(exe, version);
568+
557569
const char* termProgramVersion = getenv("TERM_PROGRAM_VERSION");
558570
if(termProgramVersion)
559571
{

0 commit comments

Comments
 (0)