Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/detection/terminalshell/terminalshell.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,16 @@ static bool getShellVersionZsh(FFstrbuf* exe, FFstrbuf* version) {
return getExeVersionGeneral(exe, version); // zsh 5.9 (arm-apple-darwin21.3.0)
}

static bool getShellVersionTidalshell(FFstrbuf* exe, FFstrbuf* version)
{
if (ffProcessAppendStdOut(version, (char* const[]){ exe->chars, "-v", NULL }) != NULL)
return false;
ffStrbufTrimRightSpace(version);
ffStrbufSubstrBeforeFirstC(version, '-');
return true;
}


#ifdef _WIN32
static bool getShellVersionWinPowerShell(FFstrbuf* exe, FFstrbuf* version) {
const char* env = getenv("POWERSHELL_VERSION");
Expand Down Expand Up @@ -296,7 +306,9 @@ bool fftsGetShellVersion(FFstrbuf* exe, const char* exeName, FFstrbuf* version)
if (ffStrEqualsIgnCase(exeName, "brush")) {
return getExeVersionGeneral(exe, version); // brush 0.2.23 (git:2835487)
}

if (ffStrEqualsIgnCase(exeName, "tidalshell")) {
return getShellVersionTidalshell(exe, version);
}
#ifdef _WIN32
if (ffStrEqualsIgnCase(exeName, "powershell") || ffStrEqualsIgnCase(exeName, "powershell_ise")) {
return getShellVersionWinPowerShell(exe, version);
Expand Down
3 changes: 3 additions & 0 deletions src/detection/terminalshell/terminalshell_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ static pid_t getTerminalInfo(FFTerminalResult* result, pid_t pid) {
ffStrbufEqualS(&result->processName, "chezmoi") || // #762
ffStrbufEqualS(&result->processName, "proot") ||
ffStrbufEqualS(&result->processName, "script") ||
ffStrbufEqualS(&result->processName, "tidalshell") ||
#ifdef __linux__
ffStrbufStartsWithS(&result->processName, "Relay(") || // Unknown process in WSL2
ffStrbufStartsWithS(&result->processName, "flatpak-") || // #707
Expand Down Expand Up @@ -289,6 +290,8 @@ static void setShellInfoDetails(FFShellResult* result) {
ffStrbufInitStatic(&result->prettyName, "Oils");
} else if (ffStrbufEqualS(&result->processName, "busybox")) {
ffStrbufInitStatic(&result->prettyName, "ash");
} else if (ffStrbufEqualS(&result->processName, "tidalshell")) {
ffStrbufInitStatic(&result->prettyName, "TidalShell");
} else {
// https://github.com/fastfetch-cli/fastfetch/discussions/280#discussioncomment-3831734
ffStrbufInitS(&result->prettyName, result->exeName);
Expand Down
2 changes: 2 additions & 0 deletions src/detection/terminalshell/terminalshell_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ static void setShellInfoDetails(FFShellResult* result) {
ffStrbufSetS(&result->prettyName, "Windows Explorer");
} else if (ffStrbufIgnCaseEqualS(&result->prettyName, "busybox")) {
ffStrbufInitStatic(&result->prettyName, "ash");
} else if (ffStrbufIgnCaseEqualS(&result->prettyName, "tidalshell")) {
ffStrbufSetS(&result->prettyName, "TidalShell");
}
}

Expand Down