Commit 7f3f69e
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
0 commit comments