Added status code to prompt

master
Jef Roosens 2021-04-21 19:36:08 +02:00
parent ee83b159ae
commit c844e21b7b
Signed by: Jef Roosens
GPG Key ID: B580B976584B5F30
1 changed files with 9 additions and 1 deletions

10
.bashrc
View File

@ -10,8 +10,16 @@ export EDITOR=nvim
export PATH="$HOME/.local/bin:$HOME/.cargo/bin:$PATH"
# =====FUNCTIONS=====
function print_status() {
if [[ $1 -ne 0 ]]; then
echo "$1 "
fi
}
# =====PROMPT=====
PS1=" \e[1;33m\w\e[m \n \e[1;36m>\e[m "
PS1=" \e[1;31m\$(print_status \$?)\e[1;33m\w\e[m \n \e[1;36m>\e[m "
# =====EXTERNAL SCRIPTS=====