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