File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -460,8 +460,11 @@ _project_open_complete_bash() {
460460if [[ -n " ${BASH_VERSION:- } " ]]; then
461461 complete -F _project_open_complete_bash project_open
462462 complete -F _project_open_complete_bash po
463- # Rebuild the project cache in the background, detached so no job message prints.
464- ( _project_open_build_cache & ) > /dev/null 2>&1
463+ # Rebuild the project cache in the background, detached so no job message
464+ # prints. Interactive only, so sourcing in scripts/tests spawns nothing.
465+ if [[ $- == * i* ]]; then
466+ ( _project_open_build_cache & ) > /dev/null 2>&1
467+ fi
465468fi
466469
467470if [[ -n " ${ZSH_VERSION:- } " ]]; then
@@ -504,7 +507,10 @@ if [[ -n "${ZSH_VERSION:-}" ]]; then
504507 else
505508 add-zsh-hook precmd _project_open_register_zsh
506509 fi
507- _project_open_build_cache &!'
510+ # Interactive only, so a non-interactive `zsh -c "source ..."` spawns no job.
511+ if [[ -o interactive ]]; then
512+ _project_open_build_cache &!
513+ fi'
508514fi
509515
510516project_edit () {
You can’t perform that action at this time.
0 commit comments