Last active
October 7, 2016 13:33
-
-
Save odlp/817804b7889f608e4a8511fdbe50fdd3 to your computer and use it in GitHub Desktop.
Highlight non-zero exit status for bash-it
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
function prompt_command() { | |
highlight_non_zero_exit | |
PS1="\n${yellow}$(ruby_version_prompt) ${purple}\h ${reset_color}in ${green}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}→${reset_color} " | |
} | |
function highlight_non_zero_exit() { | |
PASS=$? | |
if [[ $PASS != 0 ]]; then | |
printf "${echo_bold_red}> Exit status $PASS <${echo_reset_color}\n" | |
fi | |
} | |
PROMPT_COMMAND=prompt_command; |
Author
odlp
commented
Oct 7, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment