exa: Unknown argument -A
erichhaemmerle opened this issue · 10 comments
I am using Exa v0.10.1. I am also using Oh My ZSH for my ZSH terminal on my MacBook Pro running Monterey . I have an alias file that I use for Oh My ZSH. I have added this alias to that file:
alias ls='exa --long --header --git --icons -a'
but every time I open my terminal now, I get:
exa: Unknown argument -A
If I type "ls" in the terminal, Exa still runs as expected without error. I only get that message when initially opening my terminal. Do I need to setup my alias differently?
You probably have something in your .zshenv
, .zprofile
or .zlogin
or possibly .zshrc
which does a ls -A
for some reason.
You could just alias ls
to this script and you can just carry on using ls
options.
I made a little fork which supports -A argument, would you like to consider it pls >_<
I looked through all my files and I do not see anywhere where "ls -A" is being used. I think -A might be the default when using ls so when doing the alias, exa doesn't know how to handle it? I'm not entirely sure. I can try to alias to that script, but I'm not sure how to do that. I clicked that link, but it looks like it had instructions if using bash and I am using zsh.
I'm having the exact same issue, exa v0.10.1, zsh 5.9 (x86_64-apple-darwin22.0) using Zap, M1 Macbook Air with macOS Ventura. Same error pops up when I open my terminal (kitty) and whenever I source
my .zshrc
file. I've also looked through my files and couldn't find any ls -A
.
EDIT: I've cleared up the issue by moving the alias ls='exa ...'
to the very bottom of my .zshrc
. That makes the error message disappear when opening the terminal or source
ing a file. Hopefully that works for you too. (But we still don't know the cause of this problem.)
@rayros25 You could try moving that alias line up file file 25% at a time until the error comes back, to find exactly which line that is causing it.
So for Oh My ZSH, I have an aliases.zsh file. I still got the error whether the alias was at the top of my aliases file or at the bottom, BUT I removed it from the aliases.zsh file all together and moved it to the bottom of my .zshrc file and now the error went away for me too.
This is why I really don't like omz. There's loads of stuff in it and you don't know what. I think it's a lot better to just add the stuff that you specifically want and use a plugin manager. I use antidote, but there are more popular alternatives.
Okay I found what was causing the issue for me. By moving the alias up through my zshrc
as suggested, I found that the line that was causing the issue for me as source /opt/homebrew/opt/chruby/share/chruby/chruby.sh
. I put this in my zshrc
because I tried working with Jekyll one time. So for me, turns out it wasn't the plugin manager at all, it was a shell script I had forgotten about.
That's funny. I just looked and mine is the exact same issue for the exact same reason. chruby.sh
Ah yeah, I guess if you alias ls
to something then run a script with some shells, it can go wrong. Closing because it has nothing to do with exa, then.