mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-05-11 05:55:17 +00:00
Don't clobber chpwd
This commit is contained in:
@ -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