Fish¶
ff hook fish installs a git alias and quiet prompt snapshots in $XDG_CONFIG_HOME/fish/config.fish, or ~/.config/fish/config.fish when XDG_CONFIG_HOME is unset. The alias runs ff git; the prompt runs ff trigger shell. See the shared capture and ownership rules.
Install¶
ff hook fish
Activate¶
Open a new Fish shell, or source the file named by the installer:
if set -q XDG_CONFIG_HOME
source "$XDG_CONFIG_HOME/fish/config.fish"
else
source ~/.config/fish/config.fish
end
Verify¶
type git
functions _fufu_ambient
ff hook -l
The alias should run ff git, and _fufu_ambient should handle fish_prompt by running ff trigger shell. The list command checks installed files. To test prompt capture, edit a disposable file, return to the prompt, then inspect ff history for the shell capture.
Files changed¶
$ ff hook fish
fish wired into ~/.config/fish/config.fish
restart the shell (or source the file) to activate it
$ cat ~/.config/fish/config.fish
alias git 'ff git' # fufu — added by `ff hook`
function _fufu_ambient --on-event fish_prompt; ff trigger shell; end # fufu — added by `ff hook`
The file and parent directory are created if missing. The marker identifies managed lines; recognized hand-written alias and prompt lines survive as described in the overview.
Remove¶
ff unhook fish removes the marked lines. Restart Fish afterward to unload the alias and event handler.
$ ff unhook fish
fish removed the alias and the prompt hook from ~/.config/fish/config.fish
$ cat ~/.config/fish/config.fish
A hand-written alias or prompt hook is reported and stays.
Troubleshooting and migration¶
The event handler works alongside prompt frameworks without wrapping their prompt function. Check that _fufu_ambient remains defined if a later configuration removes functions.
Older markers (ff hook shell install, ff shell install) and ff hook shell trigger are upgraded by ff hook fish. ff doctor reports these as stale until repaired.