diff options
author | alexg0 <alexg@alexland.org> | 2009-11-30 11:40:08 +0800 |
---|---|---|
committer | Leonid Volnitsky <leonid@volnitsky.com> | 2009-11-30 12:59:31 +0800 |
commit | 6a830906954d9054d89cf5035364b993692d1ce0 (patch) | |
tree | bfac977acbfb051271561662f5ccbfc20e764a8d | |
parent | Fixed errors related to running git-prompt.sh in Emacs shell-mode, (diff) | |
download | git-prompt-6a830906954d9054d89cf5035364b993692d1ce0.tar.gz git-prompt-6a830906954d9054d89cf5035364b993692d1ce0.tar.bz2 git-prompt-6a830906954d9054d89cf5035364b993692d1ce0.zip |
Get rid of extranious status line updates, while script (usually
.bashrc) is running.
-rwxr-xr-x | git-prompt.sh | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/git-prompt.sh b/git-prompt.sh index eb60bb4..95b0f08 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -586,10 +586,17 @@ parse_vcs_status() { #tail_local="${tail_local+$vcs_color $tail_local}${dir_color}" } - - # currently executed comman display in label +disable_set_shell_label() { trap - DEBUG >& /dev/null - trap '[[ $BASH_COMMAND != prompt_command_function ]] && set_shell_label $BASH_COMMAND' DEBUG >& /dev/null + } + +# enable stuffing currently executed command displays in label +enable_set_shell_label() { + disable_set_shell_label + # check for BASH_SOURCE being empty, no point running set_shell_label on every line of .bashrc + trap '[[ -z "$BASH_SOURCE" && ($BASH_COMMAND != prompt_command_function) ]] && + set_shell_label $BASH_COMMAND' DEBUG >& /dev/null + } ###################################################################### PROMPT_COMMAND @@ -618,6 +625,8 @@ prompt_command_function() { PROMPT_COMMAND=prompt_command_function + enable_set_shell_label + unset rc id tty modified_files file_list # vim: set ft=sh ts=8 sw=8 et: |