diff --git a/.bashrc b/.bashrc index 2380f21..4f73b05 100644 --- a/.bashrc +++ b/.bashrc @@ -73,12 +73,23 @@ set_bash_prompt() { # Update the history file after every command # This prevents a loss of history in the case of an unclean exit - history -a + history -a; + + # Make the dollar sign bold if there are background jobs, and + # underlined if there are stopped jobs + local dollar_colour=""; + if [ $(jobs -r | wc -l) -gt "0" ]; then + dollar_colour="${HC}"; + fi + if [ $(jobs -s | wc -l) -gt "0" ]; then + dollar_colour="${dollar_colour}${UL}"; + fi + PS1="${debian_chroot:+($debian_chroot)}${HOST_COLOUR}\u@\H\[\033[00m\]$(prompt_colon)\[\033[01;34m\]\w\[\033[00m\]" if [[ "$UID" = 0 ]]; then - PS1="${PS1}# " + PS1="${PS1}${dollar_colour}#${RS} " else - PS1="${PS1}\$ " + PS1="${PS1}${dollar_colour}\$${RS} " fi }