Skip to content

Commit

Permalink
Redraw only when called from subprocess
Browse files Browse the repository at this point in the history
  • Loading branch information
sorin-ionescu committed May 31, 2015
1 parent ef634f3 commit bdec6c4
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions modules/prompt/functions/prompt_sorin_setup
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,21 @@ function prompt_sorin_pwd {
}

function prompt_sorin_git_info {
# Append Git status.
if [[ -s "$_prompt_sorin_precmd_async_data" ]]; then
alias typeset='typeset -g'
source "$_prompt_sorin_precmd_async_data"
RPROMPT+='${git_info:+${(e)git_info[status]}}'
unalias typeset
if (( _prompt_sorin_precmd_async_pid > 0 )); then
# Append Git status.
if [[ -s "$_prompt_sorin_precmd_async_data" ]]; then
alias typeset='typeset -g'
source "$_prompt_sorin_precmd_async_data"
RPROMPT+='${git_info:+${(e)git_info[status]}}'
unalias typeset
fi

# Reset PID.
_prompt_sorin_precmd_async_pid=0

# Redisplay prompt.
zle && zle reset-prompt
fi

# Reset PID.
_prompt_sorin_precmd_async_pid=0

# Redisplay prompt.
zle && zle reset-prompt
}

function prompt_sorin_precmd_async {
Expand Down

0 comments on commit bdec6c4

Please sign in to comment.