I've been struggling with an issue that I cannot find mentioned anywhere and I cannot trace down. I can't leverage any of the alias command functionality in fish, which also breaks fish integrations that rely on that command (like zoxide init fish
). I can manually define aliases fine (they're just functions after all), but commands like alias ls "ls -lah"
don't work.
My suspicion is that somehow it's prefering to interpret alias
as the macOS executable rather than the fish built-in:
> alias foo="echo foo"
> foo
fish: Unknown command: foo
> type -a alias
alias is /usr/bin/alias
> alias --help
/usr/bin/alias: line 4: alias: --: invalid option
alias: usage: alias [-p] [name[=value] ... ]
I have many fish aliases defined manually in my configs and they work, just the alias
built-in itself seems to be broken.
Follow-up
Some requested additional details that don't fit in a comment:
> fish --version
fish, version 3.7.0
> set -S fish_function_path
$fish_function_path: set in global scope, unexported, with 6 elements
$fish_function_path[1]: |/Users/<REDACTED>/.config/fish/functions|
$fish_function_path[2]: |/opt/homebrew/etc/fish/functions|
$fish_function_path[3]: |/Users/<REDACTED>/.local/share/fish/vendor_functions.d|
$fish_function_path[4]: |/opt/homebrew/Cellar/fish/3.7.0/share/fish/vendor_functions.d|
$fish_function_path[5]: |/opt/homebrew/share/fish/vendor_functions.d|
$fish_function_path[6]: |/opt/homebrew/Cellar/fish/3.7.0/share/fish/functions|
alias
is defined as a function in fish. What is your fish version? What is the contents of $fish_function_path --set -S fish_function_path
alias
is defined, and found that if I explicitlysource /opt/homebrew/Cellar/fish/3.7.0/share/fish/functions/alias.fish
then thealias
command works normally in that session. Any idea why that would be necessary when that file is already in the search path?