Merge pull request #31 from kouk/ansi-escapes

use more standard ansi+csr escapes. Refs #30
This commit is contained in:
Sindre Sorhus
2013-10-16 09:58:25 -07:00

View File

@@ -68,7 +68,7 @@ prompt_pure_precmd() {
command git rev-parse --abbrev-ref @'{u}' &>/dev/null && command git rev-parse --abbrev-ref @'{u}' &>/dev/null &&
(( $(command git rev-list --count HEAD...@'{u}' 2>/dev/null) > 0 )) && (( $(command git rev-list --count HEAD...@'{u}' 2>/dev/null) > 0 )) &&
# some crazy ansi magic to inject the symbol into the previous line # some crazy ansi magic to inject the symbol into the previous line
print -Pn "\e[s\e[A\e[1G\e[`prompt_pure_string_length $prompt_pure_preprompt`C%F{cyan}⇣%f\e[u" print -Pn "\e7\e[A\e[1G\e[`prompt_pure_string_length $prompt_pure_preprompt`C%F{cyan}⇣%f\e8"
} &! } &!
# reset value since `preexec` isn't always triggered # reset value since `preexec` isn't always triggered