summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authordt-rush <nick.8.payne@gmail.com>2018-05-17 08:45:04 -0400
committerMarc Cornellà <marc.cornella@live.com>2018-05-17 14:45:04 +0200
commit3dab7e46e8815838c8099040e11a7ae9a30ba03d (patch)
tree48cac8e232f08396653b178f5ae01aa8c971f5ce /plugins
parente8aaab56b9f007cd5a285099fa101a63214622ee (diff)
downloadzsh-3dab7e46e8815838c8099040e11a7ae9a30ba03d.tar.gz
zsh-3dab7e46e8815838c8099040e11a7ae9a30ba03d.tar.bz2
zsh-3dab7e46e8815838c8099040e11a7ae9a30ba03d.zip
unset chpwd_functions before running cd to work with the path, to avoid side-effects if the user has set any chpwd_functions which cause output, such as is the case if the user is using auto-ls (#6830)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/shrink-path/shrink-path.plugin.zsh5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/shrink-path/shrink-path.plugin.zsh b/plugins/shrink-path/shrink-path.plugin.zsh
index f111962a5..6dd6a930f 100644
--- a/plugins/shrink-path/shrink-path.plugin.zsh
+++ b/plugins/shrink-path/shrink-path.plugin.zsh
@@ -94,6 +94,11 @@ shrink_path () {
(( tilde )) && dir=${dir/$HOME/\~}
tree=(${(s:/:)dir})
(
+ # unset chpwd_functions since we'll be calling `cd` and don't
+ # want any side-effects (eg., if the user was using auto-ls)
+ chpwd_functions=()
+ # unset chpwd since even if chpwd_functions is (), zsh will
+ # attempt to execute chpwd
unfunction chpwd 2> /dev/null
if [[ $tree[1] == \~* ]] {
cd ${~tree[1]}