Shell: Rewrite function
This commit is contained in:
parent
f64ecff479
commit
c6c4a47cf5
1 changed files with 10 additions and 20 deletions
26
neofetch
26
neofetch
|
@ -499,33 +499,23 @@ get_shell() {
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [[ "$shell_version" == "on" ]]; then
|
if [[ "$shell_version" == "on" ]]; then
|
||||||
shell+=" "
|
|
||||||
case "${SHELL##*/}" in
|
case "${SHELL##*/}" in
|
||||||
"bash")
|
"bash") shell+="${BASH_VERSION/-*}" ;;
|
||||||
shell+=" ${BASH_VERSION/-*}"
|
|
||||||
;;
|
|
||||||
|
|
||||||
"zsh")
|
"fish" | "zsh" | "tcsh" | "csh")
|
||||||
shell+="$(zsh --version)"
|
shell+="$("$SHELL" --version)"
|
||||||
shell="${shell/ zsh}"
|
shell="${shell/${SHELL##*/}}"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"mksh" | "ksh")
|
"mksh" | "ksh")
|
||||||
shell+="$("$SHELL" -c 'printf "%s" "$KSH_VERSION"')"
|
shell+="$("$SHELL" -c 'printf "%s" "$KSH_VERSION"')"
|
||||||
shell="${shell/ * KSH}"
|
shell="${shell/ * KSH}"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"tcsh" | "csh")
|
|
||||||
shell+="$("$SHELL" --version)"
|
|
||||||
shell="${shell/tcsh}"
|
|
||||||
shell="${shell/\(*}"
|
|
||||||
;;
|
|
||||||
|
|
||||||
"fish")
|
|
||||||
shell+="$(fish --version)"
|
|
||||||
shell="${shell/fish, version}"
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# Remove unwanted info
|
||||||
|
shell="${shell/, version}"
|
||||||
|
shell="${shell/options*}"
|
||||||
shell="${shell/\(*\)}"
|
shell="${shell/\(*\)}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue