Skip to content

Commit

Permalink
zsh: at startup, cleanup hooks from a running instance
Browse files Browse the repository at this point in the history
When liquidprompt is reloaded, we have to cleanup the existing hooks
(precmd, preexec...) as the new settings may not use them.
  • Loading branch information
dolmen committed Jan 13, 2016
1 parent bce33b4 commit 454112f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions liquidprompt
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ elif test -n "${ZSH_VERSION-}" ; then

# For ZSH, autoload required functions
autoload -Uz add-zsh-hook

# Disable previous hooks as options that set them
# may have changed
{
add-zsh-hook -d precmd _lp_set_prompt
add-zsh-hook -d preexec _lp_runtime_before
add-zsh-hook -d precmd _lp_runtime_after
} >/dev/null
else
echo "liquidprompt: shell not supported" >&2
return
Expand Down

0 comments on commit 454112f

Please sign in to comment.