mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-10 07:00:08 +01:00
TerminalShell: add --shell-version and --terminal-version options to disable shell / terminal version detection
in case that users don't like it
This commit is contained in:
@@ -352,12 +352,17 @@ const FFTerminalShellResult* ffDetectTerminalShell(const FFinstance* instance)
|
||||
|
||||
getTerminalFromEnv(&result);
|
||||
getUserShellFromEnv(instance, &result);
|
||||
getShellVersion(&result.shellExe, result.shellExeName, &result.shellVersion);
|
||||
|
||||
if(strcasecmp(result.shellExeName, result.userShellExeName) != 0)
|
||||
getShellVersion(&result.userShellExe, result.userShellExeName, &result.userShellVersion);
|
||||
else
|
||||
ffStrbufSet(&result.userShellVersion, &result.shellVersion);
|
||||
ffStrbufClear(&result.shellVersion);
|
||||
if(instance->config.shellVersion)
|
||||
{
|
||||
getShellVersion(&result.shellExe, result.shellExeName, &result.shellVersion);
|
||||
|
||||
if(strcasecmp(result.shellExeName, result.userShellExeName) != 0)
|
||||
getShellVersion(&result.userShellExe, result.userShellExeName, &result.userShellVersion);
|
||||
else
|
||||
ffStrbufSet(&result.userShellVersion, &result.shellVersion);
|
||||
}
|
||||
|
||||
if(ffStrbufEqualS(&result.shellProcessName, "pwsh"))
|
||||
ffStrbufInitS(&result.shellPrettyName, "PowerShell");
|
||||
@@ -383,7 +388,9 @@ const FFTerminalShellResult* ffDetectTerminalShell(const FFinstance* instance)
|
||||
ffStrbufInitCopy(&result.terminalPrettyName, &result.terminalProcessName);
|
||||
|
||||
ffStrbufInit(&result.terminalVersion);
|
||||
fftsGetTerminalVersion(&result.terminalProcessName, &result.terminalExe, &result.terminalVersion);
|
||||
|
||||
if(instance->config.terminalVersion)
|
||||
fftsGetTerminalVersion(&result.terminalProcessName, &result.terminalExe, &result.terminalVersion);
|
||||
|
||||
ffThreadMutexUnlock(&mutex);
|
||||
return &result;
|
||||
|
||||
Reference in New Issue
Block a user