diff options
author | xiao <xiao.h.fan@gmail.com> | 2015-08-03 22:10:24 -0700 |
---|---|---|
committer | xiao <xiao.h.fan@gmail.com> | 2015-08-03 22:10:24 -0700 |
commit | 084792b829657cdf516799e43f89c0b8c22f4ab8 (patch) | |
tree | 31c34ed052a529214f7a43bd5a755141a28ffcc2 /plugins/last-working-dir/last-working-dir.plugin.zsh | |
parent | 3d5b3430fd9da12f6e33f534e487fe9b18928ac7 (diff) | |
download | zsh-084792b829657cdf516799e43f89c0b8c22f4ab8.tar.gz zsh-084792b829657cdf516799e43f89c0b8c22f4ab8.tar.bz2 zsh-084792b829657cdf516799e43f89c0b8c22f4ab8.zip |
Don't clobber chpwd
Diffstat (limited to 'plugins/last-working-dir/last-working-dir.plugin.zsh')
-rw-r--r-- | plugins/last-working-dir/last-working-dir.plugin.zsh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/last-working-dir/last-working-dir.plugin.zsh b/plugins/last-working-dir/last-working-dir.plugin.zsh index 75041f08e..708ae4f74 100644 --- a/plugins/last-working-dir/last-working-dir.plugin.zsh +++ b/plugins/last-working-dir/last-working-dir.plugin.zsh @@ -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" } |