diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2012-06-09 23:37:22 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2012-06-09 23:37:22 +1200 |
commit | fe2bb3adce51ac1b0e6ff2adc88ba38a0e753f0e (patch) | |
tree | 02571a7a01b2d78436139dcf298bd284e3e4b9c0 /bash | |
parent | Add return value for VCS prompt function (diff) | |
download | dotfiles-fe2bb3adce51ac1b0e6ff2adc88ba38a0e753f0e.tar.gz dotfiles-fe2bb3adce51ac1b0e6ff2adc88ba38a0e753f0e.zip |
Add nonzero jobs count to prompt
Diffstat (limited to 'bash')
-rw-r--r-- | bash/bashrc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bash/bashrc b/bash/bashrc index 94e0f7f7..4299b8b4 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -122,8 +122,14 @@ function prompt_vcs { return $? } +# Function to return the number of backgrounded jobs. +function prompt_jobs { + [[ -n "$(jobs)" ]] && echo -n "{$(jobs | wc -l | sed 's/ //g')}" + return $? +} + # Uncolored bits of my prompt, we'll color them if appropriate shortly. -PS1='[\u@\h:\w]$(prompt_vcs)\$' +PS1='[\u@\h:\w]$(prompt_vcs)$(prompt_jobs)\$' # Save some color codes based on our colour space. if [[ $COLORS -ge 256 ]]; then |