This commit is contained in:
Luk
2026-02-07 15:06:52 +08:00
parent ac89a6b599
commit c8cd6ebd8e

View File

@@ -127,13 +127,15 @@ esac
if [ "$(uname)" = "Darwin" ]; then if [ "$(uname)" = "Darwin" ]; then
MYOSVERSION=Mac`sw_vers -productVersion` MYOSVERSION=Mac`sw_vers -productVersion`
elif [ "$(uname)" = "FreeBSD" ]; then
MYOSVERSION=$(echo "$(freebsd_version)" | cut -d'-' -f1)
elif [ -f /etc/debian_version ]; then elif [ -f /etc/debian_version ]; then
MYOSVERSION=Deb`cat /etc/debian_version 2>/dev/null` MYOSVERSION=Deb`cat /etc/debian_version 2>/dev/null`
elif [ -f /etc/ubuntu_version ]; then elif [ -f /etc/ubuntu_version ]; then
MYOSVERSION=Ubt`cat /etc/ubuntu_version 2>/dev/null` MYOSVERSION=Ubt`cat /etc/ubuntu_version 2>/dev/null`
fi fi
if [[ -n "$SSH_CONNECTION" ]] || [[ "$(uname)" != "Darwin" ]]; then if [[ -n "$SSH_CONNECTION" ]] || [[ "$(uname)" != "Darwin" ]]; then
IN_SSH="^ssh" IN_SSH=">ssh"
fi fi
if [ "$color_prompt" = yes ]; then if [ "$color_prompt" = yes ]; then
PS1='<\[\033[07;32m\]\t\[\033[00m\]#\[\033[07;35m\]\u\[\033[00m\]@\[\033[07;31m\]\h\[\033[00m\]=\[\033[07;34m\]$(uname -m),$(uname),$MYOSVERSION\[\033[00m\]:\[\033[07;36m\]\w\[\033[00m\]$IN_SSH> ' PS1='<\[\033[07;32m\]\t\[\033[00m\]#\[\033[07;35m\]\u\[\033[00m\]@\[\033[07;31m\]\h\[\033[00m\]=\[\033[07;34m\]$(uname -m),$(uname),$MYOSVERSION\[\033[00m\]:\[\033[07;36m\]\w\[\033[00m\]$IN_SSH> '