Problem Statement :

On CachyOS, as of 10th July, ls commands on certain directories fail with the error :

error: invalid value ... for `--icons [<when>]`
  [possible values: always, auto, never]

For more information, try --help'.

Solution :

I always thought ls was a simple command but never extended that thought as to how icons are displayed.

Started digging through fish config to see what alias was being done for ls.

helix ~/.config/fish/config.fish

Looks like the fish config is just a placeholder/proxy for CachyOS config

Opening the actual source file shows what's been going on under the hood.

helix /usr/share/cachyos-fish-config/cachyos-config.fish

Looking through the content of this config file shows the various aliases for ls and how ls is not really ls at all but eza all along.

Now that I knew it was eza, ran the manual for it to see what is missing with icons usage as that was the error.

man eza

Voila ! Icons need a parameter now but the aliases above (lines 90 - 96) don't have any such selections.

I don't want to set always because the terminal output might become garbage when running through tty. Setting it to auto makes a lot of sense.

So let's edit it and set it to auto. sudo is needed here because it's a read-only path for normal users. It is also why helix reverted to default purple theme because it's running as root and root has no themes set up.

Using cool features of Helix to find and replace --icons text :

sudo helix /usr/share/cachyos-fish-config/cachyos-config.fish

Step=1: Press %"" in Norm"al mode to select everything. Ste= 1= +++

Step=2: Press s" to enter" select mode. Ste= 2= +++

Step=3: Type out" --icons"" to select the desired text. Ste= 3= +++

Step=4: Press c" to chang"e them. Ste= 4= +++

Step=5: Type out" --icons="auto to replace. Ste= 5= +++

Step 6: Type :wq to write and quit. Step 6

Loading up the config values again to this shell and ls is now fixed!

source ~/.config/fish/config.fish

Information

  • Updating the /usr/share/cachyos-fish-config/cachyos-config.fish is probably a bad idea.
  • The next update to Cachy might wipe this out. On the other hand, the next update might address this fix as well. I trust CachyOS with the config.
  • This post was merely how I found ls wasn't actually ls but eza all along.