#3129·devenv

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:

  1. cd/z outside DEVENV_ROOT → nested shell's _devenv_hook (on fish_prompt) writes .devenv/exit-dir and exits.
  2. Parent shell was blocked inside _devenv_hook_activate (devenv shell call). It wakes, follows the user via _devenv_builtin_cd_with_history, clears _DEVENV_HOOK_ACTIVATED, and returns.
  3. But the parent's _devenv_hook already ran for this prompt cycle — the new /Users/jozefrudy/Documents/projects/hydro never gets an activation check until the next prompt.

To reproduce

bash
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 Enter

Workaround (local patch)

After devenv hook fish | source:

fish
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
end

i.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)