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