aboutsummaryrefslogtreecommitdiffstats
path: root/.bash_prompt
diff options
context:
space:
mode:
authorStefan Crain <stefancrain@gmail.com>2014-06-17 11:34:40 -0400
committerMathias Bynens <mathias@qiwi.be>2014-06-17 20:07:17 +0200
commit3ec5769e54aaf23c07ef7beca180db698306d808 (patch)
tree32940f194b2aad33fdecbe68601ba1893df24e54 /.bash_prompt
parentab3e3f6f9e4c09895e0ffea5c0359932136cf99a (diff)
downloaddotfiles-3ec5769e54aaf23c07ef7beca180db698306d808.tar.gz
dotfiles-3ec5769e54aaf23c07ef7beca180db698306d808.tar.bz2
dotfiles-3ec5769e54aaf23c07ef7beca180db698306d808.zip
.bash_prompt: Avoid double-escaping ANSI codes
Fixes #399 and closes #402.
Diffstat (limited to '.bash_prompt')
-rw-r--r--.bash_prompt26
1 files changed, 13 insertions, 13 deletions
diff --git a/.bash_prompt b/.bash_prompt
index 5322c02..28d36f1 100644
--- a/.bash_prompt
+++ b/.bash_prompt
@@ -91,30 +91,30 @@ fi;
# Highlight the user name when logged in as root.
if [[ "${USER}" == "root" ]]; then
- userStyle="\[${red}\]";
+ userStyle="${red}";
else
- userStyle="\[${orange}\]";
+ userStyle="${orange}";
fi;
# Highlight the hostname when connected via SSH.
if [[ "${SSH_TTY}" ]]; then
- hostStyle="\[${bold}${red}\]";
+ hostStyle="${bold}${red}";
else
- hostStyle="\[${yellow}\]";
+ hostStyle="${yellow}";
fi;
# Set the terminal title to the current working directory.
-PS1="\[\033]0;\w\007\]";
-PS1+="\[${bold}\]\n"; # newline
-PS1+="\[${userStyle}\]\u"; # username
-PS1+="\[${white}\] at ";
-PS1+="\[${hostStyle}\]\h"; # host
-PS1+="\[${white}\] in ";
-PS1+="\[${green}\]\w"; # working directory
+PS1="\033]0;\w\007";
+PS1+="${bold}\n"; # newline
+PS1+="${userStyle}\u"; # username
+PS1+="${white} at ";
+PS1+="${hostStyle}\h"; # host
+PS1+="${white} in ";
+PS1+="${green}\w"; # working directory
PS1+="\$(prompt_git \"${white} on ${violet}\")"; # Git repository details
PS1+="\n";
-PS1+="\[${white}\]\$ \[${reset}\]"; # `$` (and reset color)
+PS1+="${white}\$ ${reset}"; # `$` (and reset color)
export PS1;
-PS2="\[${yellow}\]→ \[${reset}\]";
+PS2="${yellow}→ ${reset}";
export PS2;