Created
November 6, 2013 21:18
-
-
Save mbauhardt/7344258 to your computer and use it in GitHub Desktop.
ohmyzsh theme
This file contains hidden or 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
new_line() { | |
echo '' | |
} | |
reset_colors() { | |
echo -n "%{%k%}" | |
echo -n "%{%f%}" | |
} | |
prompt_status() { | |
local excl_mark=$(echo -e "\xe2\x9d\x8c") | |
local check_mark=$(echo -e "\xe2\x9c\x85") | |
local symbols | |
symbols=() | |
[[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}$RETVAL $excl_mark $(reset_colors)" | |
[[ $RETVAL -eq 0 ]] && symbols+="%{%F{green}%}$RETVAL $check_mark $(reset_colors)" | |
echo -n "$symbols" | |
} | |
## Main prompt | |
build_prompt() { | |
RETVAL=$? | |
new_line | |
prompt_status | |
new_line | |
echo -n '%#' | |
} | |
PROMPT='$(build_prompt) ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment