mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-08-07 06:08:39 +02:00
fix(per-directory-history): move fc -p out of zshaddhistory hook
Calling fc -p inside the zshaddhistory hook on every command corrupts the preexec hook mechanism, causing preexec_functions to receive an empty $1. Move fc -p to set-directory-history and set-global-history initialization functions where they execute once per toggle. Fixes #12926
This commit is contained in:
parent
5181447da8
commit
18e1124c3d
1 changed files with 2 additions and 1 deletions
|
|
@ -128,7 +128,6 @@ function _per-directory-history-addhistory() {
|
|||
fc -AI $HISTFILE
|
||||
fc -AI $_per_directory_history_directory
|
||||
fi
|
||||
fc -p $_per_directory_history_directory
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
@ -153,6 +152,7 @@ function _per-directory-history-set-directory-history() {
|
|||
HISTSIZE=$original_histsize
|
||||
if [[ -e "$_per_directory_history_directory" ]]; then
|
||||
fc -R "$_per_directory_history_directory"
|
||||
fc -p "$_per_directory_history_directory"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
@ -163,6 +163,7 @@ function _per-directory-history-set-global-history() {
|
|||
HISTSIZE=$original_histsize
|
||||
if [[ -e "$HISTFILE" ]]; then
|
||||
fc -R "$HISTFILE"
|
||||
fc -p "$HISTFILE"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue