Last active
August 29, 2015 14:01
-
-
Save jedahan/93c4e7f9282160b8b73d to your computer and use it in GitHub Desktop.
precmd for seeing if we should show push or pull arrows in the prompt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
command git rev-parse --abbrev-ref @'{u}' &>/dev/null && { | |
local arrows="" | |
(( $(command git rev-list --right-only --count HEAD...@'{u}' 2>/dev/null) > 0 )) && arrows="⇡" | |
(( $(command git rev-list --left-only --count HEAD...@'{u}' 2>/dev/null) > 0 )) && arrows+="⇣" | |
print -Pn "\e7\e[A\e[1G\e[`prompt_pure_string_length $prompt_pure_preprompt`C%F{cyan}${arrows}%f\e8" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment