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()
|
||||
{
|
||||
if [[ "${cd_hook_last_wd}" != "${PWD}" ]]; then
|
||||
cd_hook_cat_todo
|
||||
cd_hook_show_git_status
|
||||
cd_hook_last_wd="${PWD}"
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user