mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-08-12 22:31:27 +04:00
fix(per-directory-history): push directory history context on cd
Co-authored-by: mcornella <1441704+mcornella@users.noreply.github.com>
This commit is contained in:
co-authored by
mcornella
parent
97b27bb2ec
commit
003d1167da
@@ -112,6 +112,9 @@ function _per-directory-history-change-directory() {
|
||||
#read history in new file
|
||||
if [[ -e $_per_directory_history_directory ]]; then
|
||||
fc -R $_per_directory_history_directory
|
||||
# -p: push the new directory's history file as the active history context,
|
||||
# so that the history is kept up to date on every directory change.
|
||||
fc -p $_per_directory_history_directory
|
||||
fi
|
||||
fi
|
||||
}
|
||||
@@ -153,6 +156,7 @@ function _per-directory-history-set-directory-history() {
|
||||
HISTSIZE=$original_histsize
|
||||
if [[ -e "$_per_directory_history_directory" ]]; then
|
||||
fc -R "$_per_directory_history_directory"
|
||||
# -p: push the directory's history file as the active history context.
|
||||
fc -p "$_per_directory_history_directory"
|
||||
fi
|
||||
}
|
||||
@@ -164,6 +168,7 @@ function _per-directory-history-set-global-history() {
|
||||
HISTSIZE=$original_histsize
|
||||
if [[ -e "$_per_directory_history_global" ]]; then
|
||||
fc -R "$_per_directory_history_global"
|
||||
# -p: push the global history file as the active history context.
|
||||
fc -p "$_per_directory_history_global"
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user