xonecas.io
2780
D2

dotfiles-2014 / commit 4f064e6

Escape color chars when counting the length of PS1

sean2015-10-15 4f064e677d123ed80b63b0ff21404319580a8ac1 parent e345ef3

1 file changed

bashrc+4−1
@@ -167,4 +167,7 @@ function __info {
167167 COLOR1=$(tput setaf 1)
168168 COLOR2=$(tput setaf 2)
169169 COLOR3=$(tput setaf 3)
170-PS1="$COLOR3[$COLOR2\$(__info)$COLOR3] $COLOR1☠ $COLOR3($COLOR2\w$COLOR3) \$(tput setaf 7)"
170+#PS1="$COLOR3[$COLOR2\$(__info)$COLOR3] $COLOR1☠ $COLOR3($COLOR2\w$COLOR3) \$(tput setaf 7)"
171+LINE1="\[$COLOR1\]┌─\[$COLOR3\][\[$COLOR2\]\$(__info)\[$COLOR3\]]\[$COLOR1\]──\[$COLOR3\](\[$COLOR2\]\w\[$COLOR3\])\n"
172+LINE2="\[$COLOR1\]└─> \[$COLOR3\]✪ \[\$(tput setaf 7)\]"
173+PS1="$LINE1$LINE2"