mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:14:37 +02:00
better zsh and fish version detection
This commit is contained in:
@@ -156,26 +156,24 @@ static void getShellVersionBash(FFstrbuf* exe, FFstrbuf* version)
|
||||
static void getShellVersionZsh(FFstrbuf* exe, FFstrbuf* version)
|
||||
{
|
||||
ffProcessAppendStdOut(version, (char* const[]) {
|
||||
"env",
|
||||
"-i",
|
||||
exe->chars,
|
||||
"--no-rcs",
|
||||
"-c",
|
||||
"printf \"%s\" \"$ZSH_VERSION\"",
|
||||
"--version",
|
||||
NULL
|
||||
});
|
||||
ffStrbufTrimRight(version, '\n');
|
||||
ffStrbufSubstrBeforeLastC(version, ' ');
|
||||
ffStrbufSubstrAfterFirstC(version, ' ');
|
||||
}
|
||||
|
||||
static void getShellVersionFish(FFstrbuf* exe, FFstrbuf* version)
|
||||
{
|
||||
ffProcessAppendStdOut(version, (char* const[]) {
|
||||
"env",
|
||||
"-i",
|
||||
exe->chars,
|
||||
"-c",
|
||||
"printf \"%s\" \"$FISH_VERSION\"",
|
||||
"--version",
|
||||
NULL
|
||||
});
|
||||
ffStrbufTrimRight(version, '\n');
|
||||
ffStrbufSubstrAfterLastC(version, ' ');
|
||||
}
|
||||
|
||||
static void getShellVersionGeneric(FFstrbuf* exe, const char* exeName, FFstrbuf* version)
|
||||
|
||||
Reference in New Issue
Block a user