mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-07 21:50:08 +01:00
TerminalShell: support oils and elvish
This commit is contained in:
@@ -128,6 +128,21 @@ static bool getShellVersionOksh(FFstrbuf* exe, FFstrbuf* version)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool getShellVersionOils(FFstrbuf* exe, FFstrbuf* version)
|
||||
{
|
||||
if(ffProcessAppendStdOut(version, (char* const[]) {
|
||||
exe->chars,
|
||||
"--version",
|
||||
NULL
|
||||
}) != NULL)
|
||||
return false;
|
||||
|
||||
// Oils 0.18.0 https://www.oilshell.org/...
|
||||
ffStrbufSubstrAfterFirstC(version, ' ');
|
||||
ffStrbufSubstrBeforeFirstC(version, '\t');
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool getShellVersionNushell(FFstrbuf* exe, FFstrbuf* version)
|
||||
{
|
||||
ffStrbufSetS(version, getenv("NU_VERSION"));
|
||||
@@ -170,6 +185,10 @@ bool fftsGetShellVersion(FFstrbuf* exe, const char* exeName, FFstrbuf* version)
|
||||
return getShellVersionKsh(exe, version);
|
||||
if(strcasecmp(exeName, "oksh") == 0)
|
||||
return getShellVersionOksh(exe, version);
|
||||
if(strcasecmp(exeName, "oil.ovm") == 0)
|
||||
return getShellVersionOils(exe, version);
|
||||
if(strcasecmp(exeName, "elvish") == 0)
|
||||
return getExeVersionRaw(exe, version);
|
||||
if(strcasecmp(exeName, "python") == 0 && getenv("XONSH_VERSION"))
|
||||
{
|
||||
ffStrbufSetS(version, getenv("XONSH_VERSION"));
|
||||
|
||||
Reference in New Issue
Block a user