summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2014-10-20 15:26:41 +0200
committerJan Pokorný <jpokorny@redhat.com>2014-10-20 15:26:41 +0200
commit43847ec87dde047b298b801eabe456215899e58b (patch)
treed0b3fc39045c02d49db2f4151947d3f23835fefa
parentaa411c70fe1363d364724662112bd84f145a1c39 (diff)
downloaddotfiles-43847ec87dde047b298b801eabe456215899e58b.zip
dotfiles-43847ec87dde047b298b801eabe456215899e58b.tar.gz
dotfiles-43847ec87dde047b298b801eabe456215899e58b.tar.xz
Bash config: PS1 now indicates vim running on background
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rw-r--r--.bashrc3
1 files changed, 2 insertions, 1 deletions
diff --git a/.bashrc b/.bashrc
index 4001682..2b89ec7 100644
--- a/.bashrc
+++ b/.bashrc
@@ -66,7 +66,8 @@ PROMPT_COMMAND='(history -a; [ ${_postexec_flag} -ne 0 ]) \
_bash_tick="${XDG_RUNTIME_DIR:-${TMPDIR:-/var/run}}/_bash_tick.$$"
PS1='\[\033[01;34m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\[\033[$(
_ps_ret=$?
- [ -n "${MC_SID}" ] && _ps_mc_char="#" || _ps_mc_char="|"
+ [ -n "${MC_SID}" ] && _ps_mc_char="#" \
+ || { jobs | grep -q vim && _ps_mc_char="&" || _ps_mc_char="|"; }
klist -s && { _ps_lpar="("; _ps_rpar=")"; } || { _ps_lpar="["; _ps_rpar="]"; }
git rev-parse --git-dir &>/dev/null \
&& { git diff-files --quiet \