fish hook: direct project→project jump (e.g. zoxide) doesn't activate new project's shell until extra prompt
Author: jozefRudyCreated Aug 28, 2026Updated Sep 15, 2026
Labelsbugshell activation
Describe the bug
With the native fish hook (devenv hook fish | source), jumping directly from one devenv project to another (e.g. via z/zoxide, or cd ../other-project) leaves the new project's shell unactivated until an extra prompt (pressing Enter). The activation output (Validating lock, Running tasks, etc.) only appears on the next prompt.
Root cause
When inside a hook-spawned nested devenv shell:
cd/zoutsideDEVENV_ROOT→ nested shell's_devenv_hook(onfish_prompt) writes.devenv/exit-dirand exits.- Parent shell was blocked inside
_devenv_hook_activate(devenv shellcall). It wakes, follows the user via_devenv_builtin_cd_with_history, clears_DEVENV_HOOK_ACTIVATED, and returns. - But the parent's
_devenv_hookalready ran for this prompt cycle — the new/Users/jozefrudy/Documents/projects/hydronever gets an activation check until the next prompt.
To reproduce
mkdir a b
( cd a && git init && devenv init && devenv allow )
( cd b && git init && devenv init && devenv allow )
fish -C 'devenv hook fish | source'
cd a # shell A activates
cd ../b # prompt appears immediately, but shell B only activates after pressing EnterWorkaround (local patch)
After devenv hook fish | source:
functions -c _devenv_hook_activate _devenv_hook_activate_orig
function _devenv_hook_activate
_devenv_hook_activate_orig
if test -z "" -a -z ""
_devenv_hook
end
endi.e. after following the user out of the exited shell, re-run the activation check for the new /Users/jozefrudy/Documents/projects/hydro.
Version
devenv 2.2.1, fish 4.8.1, macOS (aarch64-darwin)
Source: cachix/devenv