|
@@ -24,7 +24,7 @@ if [ -f /etc/debian_version ]; then
|
|
PR_OS_NAME="debian/${PR_OS_NAME} $(</etc/debian_version)"
|
|
PR_OS_NAME="debian/${PR_OS_NAME} $(</etc/debian_version)"
|
|
fi
|
|
fi
|
|
if [ -f /etc/debian_chroot ]; then
|
|
if [ -f /etc/debian_chroot ]; then
|
|
- PR_OS_NAME="${PR_OS_NAME} -> ${PR_LIGHT_RED}chroot:${PR_WHITE} $(</etc/debian_version)"
|
|
|
|
|
|
+ PR_OS_NAME="${PR_OS_NAME} ${PR_LIGHT_RED}chroot:${PR_WHITE}$(</etc/debian_version)"
|
|
fi
|
|
fi
|
|
fi
|
|
fi
|
|
PR_OS_NAME="${PR_OS_NAME} ${PR_OS_ARCH}"
|
|
PR_OS_NAME="${PR_OS_NAME} ${PR_OS_ARCH}"
|
|
@@ -35,6 +35,12 @@ else
|
|
export PR_OS_PTY=$(print -P %l)
|
|
export PR_OS_PTY=$(print -P %l)
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
+if [ -n "$SSH_CLIENT" ]; then
|
|
|
|
+ export PR_OS_SSH="${PR_LIGHT_RED}ssh:"
|
|
|
|
+else
|
|
|
|
+ export PR_OS_SSH=
|
|
|
|
+fi
|
|
|
|
+
|
|
if [ $UID = 0 ]; then
|
|
if [ $UID = 0 ]; then
|
|
export PR_ROOT_PREFIX='*'
|
|
export PR_ROOT_PREFIX='*'
|
|
else
|
|
else
|
|
@@ -51,20 +57,9 @@ function mytitle {
|
|
}
|
|
}
|
|
|
|
|
|
function preexec {
|
|
function preexec {
|
|
-
|
|
|
|
- binonly=(emacs mplayer lftp most more less rsu)
|
|
|
|
- args=(${=1})
|
|
|
|
- argsr=(${=2})
|
|
|
|
-
|
|
|
|
- if [[ $args[0] != $argsr[0] ]]; then
|
|
|
|
- args[0]=$argsr[0]
|
|
|
|
- fi
|
|
|
|
-
|
|
|
|
- if [[ -n ${(M)binonly:#$args[0]} ]]; then
|
|
|
|
- args=$args[0]
|
|
|
|
- fi
|
|
|
|
-
|
|
|
|
- mytitle "$args"
|
|
|
|
|
|
+ local -a buffer
|
|
|
|
+ buffer=(${=1})
|
|
|
|
+ mytitle "$buffer[1]"
|
|
}
|
|
}
|
|
|
|
|
|
function precmd {
|
|
function precmd {
|
|
@@ -76,15 +71,13 @@ myprompt() {
|
|
PROMPT="-(%n@%m)-(%(!.%d.%~))->"
|
|
PROMPT="-(%n@%m)-(%(!.%d.%~))->"
|
|
else
|
|
else
|
|
PROMPT='\
|
|
PROMPT='\
|
|
-$PR_BLUE\
|
|
|
|
-%1(j.-(${PR_YELLOW}jobs:$PR_WHITE%j$PR_BLUE).)\
|
|
|
|
-$PR_BLUE-(\
|
|
|
|
-%(!.$PR_RED%n.$PR_LIGHT_GREEN%n)\
|
|
|
|
-$PR_WHITE@\
|
|
|
|
-$PR_MAGENTA%m$PR_BLUE\
|
|
|
|
-)-(\
|
|
|
|
-$PR_WHITE$PR_OS_NAME$PR_BLUE)-($PR_WHITE%(!.%d.%~)$PR_BLUE)
|
|
|
|
-%0(?..${PR_RED}ret:$PR_WHITE%?$PR_BLUE)>$PR_NO_COLOUR'
|
|
|
|
|
|
+${PR_BLUE}\
|
|
|
|
+%1(j.-(${PR_YELLOW}jobs:${PR_WHITE}%j${PR_BLUE}).)\
|
|
|
|
+${PR_BLUE}-(\
|
|
|
|
+%(!.${PR_RED}%n.${PR_LIGHT_GREEN}%n)\
|
|
|
|
+${PR_WHITE}@${PR_OS_SSH}${PR_MAGENTA}%m${PR_WHITE} ${PR_OS_PTY}${PR_BLUE})-(\
|
|
|
|
+${PR_WHITE}${PR_OS_NAME}${PR_BLUE})-(${PR_WHITE}%(!.%d.%~)${PR_BLUE})
|
|
|
|
+%0(?..${PR_RED}ret:${PR_WHITE}%?${PR_BLUE})>${PR_NO_COLOUR}'
|
|
fi
|
|
fi
|
|
}
|
|
}
|
|
|
|
|