diff --git a/src/detection/terminalshell/terminalshell.c b/src/detection/terminalshell/terminalshell.c index b3c7d67108..905eca2c48 100644 --- a/src/detection/terminalshell/terminalshell.c +++ b/src/detection/terminalshell/terminalshell.c @@ -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"); @@ -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); diff --git a/src/detection/terminalshell/terminalshell_linux.c b/src/detection/terminalshell/terminalshell_linux.c index 1eccf26ebd..35c050c7c1 100644 --- a/src/detection/terminalshell/terminalshell_linux.c +++ b/src/detection/terminalshell/terminalshell_linux.c @@ -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 @@ -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); diff --git a/src/detection/terminalshell/terminalshell_windows.c b/src/detection/terminalshell/terminalshell_windows.c index d037663c83..d7bc9c0547 100644 --- a/src/detection/terminalshell/terminalshell_windows.c +++ b/src/detection/terminalshell/terminalshell_windows.c @@ -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"); } }