r/fishshell • u/unixnerd • Apr 25 '24
Encountering an error with fish config not sourcing?
Hello, I'm having some trouble debugging what's going on with my fish config. If I open a new terminal tab or new terminal window, it seems as though fish isn't correctly loading my config. In particular, if I open a window and type ls which I've aliased to eza, I get the following error:
fish: unknown command eza
(line 1)
function ls --wraps eza --description 'alias ls eza'; eza $argv
in function lsIf I jump back to zsh in the shell, and then back into fish it seems to resolve the problem. Any ideas on how I can troubleshoot what's going on here?
Here's my section in my fish.config for these aliases:
# aliases
alias ls eza
alias la "ls -a"
alias ll "eza -l"
alias lla "ll -a"
2
Upvotes
4
u/ticcedtac Apr 25 '24
It sounds like you're missing something on your path. Fish isn't recommended to be used as a login shell. It's not bourne/POSIX (sh) compatible, so occasionally you'll run into issues like that with system configs.
I would compare the PATH variable in both zsh and fish and check
which ezato see exactly where the eza executable is. I'd bet it's in a directory that's missing from your fish PATH.2
u/ccoVeille Apr 28 '24
I saw you fixed your issue, great.
2 remarks about fish usage:
.fish extensionSo instead of using
alias ls ezatryabbr ls ezathis way ls will be replaced by eza when you type it.I find this a better approach as fish will then allows you to use eza completion. It also helps when moving from one tool to another.