Skip to content

Commit 7f3f69e

Browse files
mightyguavaclaude
andauthored
fix(fish): activate hermit env on shell startup (#576)
## Problem The `activate_hermit` handler in the fish hooks is registered only with `--on-variable PWD`. In fish, that fires on *subsequent changes* to `$PWD`, not on the value already set when the shell starts. Opening a terminal directly into a hermit directory therefore never activates the environment — you have to `cd` out and back in. ## Fix Call `activate_hermit` once at the end of `fish_hooks.fish`. The hook file is sourced from `~/.config/fish/conf.d/hermit.fish` on every shell startup, so this handles the initial directory while `--on-variable PWD` continues to handle `cd`. This mirrors the existing shell hooks: - **zsh** (`shell/zsh.go`): calls `change_hermit_env` immediately after registering the `chpwd` hook. - **bash** (`shell/bash.go`): runs `change_hermit_env` via `PROMPT_COMMAND`, which fires before the first prompt too. Fish was the only shell not activating on startup. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 80b9db2 commit 7f3f69e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

shell/files/fish_hooks.fish

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ function __complete_hermit
3535
end
3636

3737
complete -f -c hermit -a "(__complete_hermit)"
38+
39+
activate_hermit

0 commit comments

Comments
 (0)