Properly cleanup fresh prompt theme
If `prompt <theme>` is used, prior to this patch the `fresh_line_one` precmd hook would not be removed. This is no longer the case and cleanup is correctly performed.
This commit is contained in:
parent
d0cf713a02
commit
88fdfe7a84
@ -63,6 +63,12 @@ fresh_line_one() {
|
|||||||
# First get the last commands exit code before doing anything
|
# First get the last commands exit code before doing anything
|
||||||
local exit_code=$?
|
local exit_code=$?
|
||||||
|
|
||||||
|
# Clean up if fresh is no longer the current prompt theme
|
||||||
|
if [[ "`prompt -c | tail -1 | xargs`" != "fresh" ]]; then
|
||||||
|
add-zsh-hook -d precmd fresh_line_one
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
# Construct the time and directory portions of the prompt
|
# Construct the time and directory portions of the prompt
|
||||||
local time_stamp="%{%F{244}%}%D{%H:%M:%S}%{%f%}"
|
local time_stamp="%{%F{244}%}%D{%H:%M:%S}%{%f%}"
|
||||||
[[ -n $SANDBOX_HOME ]] && \
|
[[ -n $SANDBOX_HOME ]] && \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user