mirror of
https://gitee.com/mirrors/ohmyzsh.git
synced 2026-10-13 02:34:22 +08:00
Don't clobber chpwd
This commit is contained in:
1 parent
3d5b3430fd
commit
084792b829
2 files changed
+6
-2
No files matched your search
@@ -8,7 +8,9 @@ mkdir -p $ZSH_CACHE_DIR
|
||||
cache_file="$ZSH_CACHE_DIR/last-working-dir"
|
||||
|
||||
# Updates the last directory once directory is changed.
|
||||
function chpwd() {
|
||||
typeset -ga chpwd_functions
|
||||
chpwd_functions+='chpwd_last_working_dir'
|
||||
function chpwd_last_working_dir() {
|
||||
# Use >| in case noclobber is set to avoid "file exists" error
|
||||
pwd >| "$cache_file"
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user