mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-22 04:51:12 +02:00
Merge 99486342e5 into 0eecd2821e
This commit is contained in:
commit
c727cddcde
1 changed files with 12 additions and 4 deletions
|
|
@ -121,14 +121,22 @@ function _per-directory-history-addhistory() {
|
|||
true
|
||||
else
|
||||
print -Sr -- "${1%%$'\n'}"
|
||||
# instantly write history if set options require it.
|
||||
# always write to both history files so history is always
|
||||
# preserved regardless of which mode the user is in.
|
||||
fc -AI $HISTFILE
|
||||
fc -AI $_per_directory_history_directory
|
||||
if [[ -o share_history ]] || \
|
||||
[[ -o inc_append_history ]] || \
|
||||
[[ -o inc_append_history_time ]]; then
|
||||
fc -AI $HISTFILE
|
||||
fc -AI $_per_directory_history_directory
|
||||
: # already saved via fc -AI above
|
||||
fi
|
||||
# When in directory mode, push the current history stack so
|
||||
# subsequent searches use the per-directory history file.
|
||||
# In global mode, skip the push so the global history remains
|
||||
# active — the command was already saved to both files above.
|
||||
if [[ $_per_directory_history_is_global == false ]]; then
|
||||
fc -p $_per_directory_history_directory
|
||||
fi
|
||||
fc -p $_per_directory_history_directory
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue