|
@@ -1,5 +1,6 @@
|
|
-
|
|
|
|
-# prompt config
|
|
|
|
|
|
+#
|
|
|
|
+# Prompt config
|
|
|
|
+#
|
|
|
|
|
|
setopt prompt_subst
|
|
setopt prompt_subst
|
|
|
|
|
|
@@ -19,12 +20,12 @@ export PR_OS_ARCH=$(uname -m)
|
|
|
|
|
|
if [ -f /etc/debian_version ]; then
|
|
if [ -f /etc/debian_version ]; then
|
|
if [ "$PR_OS_NAME" = "Linux" ]; then
|
|
if [ "$PR_OS_NAME" = "Linux" ]; then
|
|
- PR_OS_NAME="debian $(</etc/debian_version)"
|
|
|
|
|
|
+ PR_OS_NAME="debian $(</etc/debian_version)"
|
|
else
|
|
else
|
|
- 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}"
|
|
@@ -41,15 +42,13 @@ else
|
|
export PR_OS_SSH=
|
|
export PR_OS_SSH=
|
|
fi
|
|
fi
|
|
|
|
|
|
-if [ $UID = 0 ]; then
|
|
|
|
|
|
+if [ "$UID" = 0 ]; then
|
|
export PR_ROOT_PREFIX='*'
|
|
export PR_ROOT_PREFIX='*'
|
|
else
|
|
else
|
|
export PR_ROOT_PREFIX=
|
|
export PR_ROOT_PREFIX=
|
|
fi
|
|
fi
|
|
|
|
|
|
function mytitle {
|
|
function mytitle {
|
|
- # if running konsole, setting current directory name in tab
|
|
|
|
- [ "$KONSOLE_DCOP_SESSION" ] && dcop $KONSOLE_DCOP_SESSION renameSession "${PR_ROOT_PREFIX}${1}"
|
|
|
|
# if running screen, setting current directory name in caption/statusbar
|
|
# if running screen, setting current directory name in caption/statusbar
|
|
[ "$TERM" = "screen" ] && echo -ne "\033k${PR_ROOT_PREFIX}${1}\033\\"
|
|
[ "$TERM" = "screen" ] && echo -ne "\033k${PR_ROOT_PREFIX}${1}\033\\"
|
|
# if running 'xterm like' terminal setting directory name in title bar
|
|
# if running 'xterm like' terminal setting directory name in title bar
|
|
@@ -68,9 +67,9 @@ function precmd {
|
|
|
|
|
|
myprompt() {
|
|
myprompt() {
|
|
if [ "$TERM" = "dumb" ]; then
|
|
if [ "$TERM" = "dumb" ]; then
|
|
- PROMPT="-(%n@%m)-(%(!.%d.%~))->"
|
|
|
|
|
|
+ PROMPT="-(%n@%m)-(%(!.%d.%~))->"
|
|
else
|
|
else
|
|
- PROMPT='\
|
|
|
|
|
|
+ PROMPT='\
|
|
${PR_BLUE}\
|
|
${PR_BLUE}\
|
|
%1(j.-(${PR_YELLOW}jobs:${PR_WHITE}%j${PR_BLUE}).)\
|
|
%1(j.-(${PR_YELLOW}jobs:${PR_WHITE}%j${PR_BLUE}).)\
|
|
${PR_BLUE}-(\
|
|
${PR_BLUE}-(\
|
|
@@ -81,4 +80,5 @@ ${PR_WHITE}${PR_OS_NAME}${PR_BLUE})-(${PR_WHITE}%(!.%d.%~)${PR_BLUE})
|
|
fi
|
|
fi
|
|
}
|
|
}
|
|
|
|
|
|
-myprompt
|
|
|
|
|
|
+myprompt
|
|
|
|
+
|