cd_hook: do not invoke actions if in a bash subshell
This commit is contained in:
parent
628094554b
commit
206a087d54
@ -93,11 +93,14 @@ function cd_hook_show_git_status()
|
||||
}
|
||||
function cd_hook()
|
||||
{
|
||||
if [[ $BASH_SUBSHELL == 0 ]]; then
|
||||
# do not invoke these CD hooks in subshells
|
||||
if [[ "${cd_hook_last_wd}" != "${PWD}" ]]; then
|
||||
cd_hook_cat_todo
|
||||
cd_hook_show_git_status
|
||||
cd_hook_last_wd="${PWD}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
# Invoke cd_hook when we're loaded
|
||||
cd_hook
|
||||
|
Loading…
x
Reference in New Issue
Block a user