mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-25 23:30:08 +00:00
last-working-dir: disable chpwd_last_working_dir in subshells (#6817)
This commit is contained in:
parent
e8c328cb39
commit
18effd77db
1 changed files with 4 additions and 2 deletions
|
@ -4,8 +4,10 @@ typeset -g ZSH_LAST_WORKING_DIRECTORY
|
||||||
# Updates the last directory once directory is changed
|
# Updates the last directory once directory is changed
|
||||||
chpwd_functions+=(chpwd_last_working_dir)
|
chpwd_functions+=(chpwd_last_working_dir)
|
||||||
chpwd_last_working_dir() {
|
chpwd_last_working_dir() {
|
||||||
|
if [ "$ZSH_SUBSHELL" = 0 ]; then
|
||||||
local cache_file="$ZSH_CACHE_DIR/last-working-dir"
|
local cache_file="$ZSH_CACHE_DIR/last-working-dir"
|
||||||
pwd >| "$cache_file"
|
pwd >| "$cache_file"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Changes directory to the last working directory
|
# Changes directory to the last working directory
|
||||||
|
|
Loading…
Reference in a new issue