dim_yellow="\e[1;33m"
fi
- # build the prompt
+ charStyle="$reset$bold$black"
+ gitStyle="\[$white\]on \[$magenta\]"
+ case "$BACKGROUND" in
+ DARK|dark)
+ hostStyle="$reset$cyan"
+ ;;
+ LIGHT|light)
+ hostStyle="$reset$blue"
+ ;;
+ esac
+ wdirStyle="$reset$green"
+
# logged in as root
if [[ "$USER" == "root" ]]; then
- userStyle="\[$bold$red\]"
+ userStyle="$bold$red"
else
- userStyle="\[$orange\]"
+ userStyle="$orange"
fi
- # connected via ssh
- if [[ "$SSH_TTY" ]]; then
- hostStyle="\[$bold$red\]"
- else
- hostStyle="\[$yellow\]"
- fi
-
- # set the terminal title to the current working directory
- PS1="\[\033]0;\w\007\]"
-
- PS1+="\n" # newline
+ # build the prompt
+ # display the user, host and current working directory in the terminal title
+ case "$TERM" in
+ *rxvt*|screen*|*term*|vt100)
+ PS1="\[\033]0;\u@\h:\w\007\]"
+ case "$TERM" in
+ screen*)
+ PS1+"\[\033k\u@\h:\w\033\\\]" # Set screen/tmux caption
+ ;;
+ esac
+ ;;
+
+ *)
+ PS1=""
+ ;;
+ esac
+
+ #PS1+="\n" # newline
PS1+="\[$userStyle\]\u" # username
- PS1+="\[$reset$white\]@"
- PS1+="\[$hostStyle\]\h" # host
- PS1+="\[$reset$white\]: "
- PS1+="\[$green\]\w" # working directory
- PS1+="\$(prompt_git \"$white on $cyan\")" # git repository details
- PS1+="\n"
- PS1+="\[$reset$white\]\$ \[$reset\]" # $ (and reset color)
+ PS1+="\[$charStyle\]@"
+ PS1+="\[$hostStyle\]\h " # host
+ #PS1+="\[$charStyle\]: "
+ PS1+="\[$wdirStyle\]\W " # working directory
+ PS1+="\$(prompt_git \"$gitStyle\")" # git repository details
+ #PS1+="\n"
+ PS1+="\[$charStyle\]\$ \[$reset\]" # $ (and reset color)
export PS1
}