Fix hostname and substr syntax

This commit is contained in:
Henrik Lissner 2013-07-28 04:17:25 +00:00
parent 54ca66d8e5
commit 0bcd953e19

View file

@ -1,6 +1,13 @@
prompt_pwd() {
SHORTPWD=`print -Pn "%4~"`
[[ "${SHORT_PWD:0:1}" =~ "[^/~]" ]] && SHORT_PWD=".../$SHORT_PWD"
if [[ -n "${ZSH_VERSION:-}" ]]
then _pwd="${SHORTPWD[0,1]}"
else _pwd="${SHORTPWD:0:1}"
fi
[[ $_pwd =~ "[^/~]" ]] && SHORTPWD=".../$SHORTPWD"
echo -n $SHORTPWD
}
@ -28,7 +35,8 @@ prompt() {
# Show the hostname if this is an SSH session
if [[ -n $SSH_CLIENT ]]; then
echo -n "$(hostname) "
echo -n "%{$fg[blue]%}"
echo -n " $(hostname)"
fi
# The prompt