Skip to content

ls -lS and ls -lSr are messed up! Plus, errors present after uninstalling in config.fish. #24

@herbanonymous

Description

@herbanonymous

Expected result: things sort in the correct order.

sage@arch:~$ ls -lS
total 8
drwxr-xr-x 2 sage sage 4096 Aug 16 20:44 Pictures
drwxr-xr-x 2 sage sage   79 Aug 16 20:29 Downloads
drwxr-xr-x 2 sage sage    6 Aug 16 18:32 Desktop
drwxr-xr-x 2 sage sage    6 Aug 16 18:32 Documents
drwxr-xr-x 2 sage sage    6 Aug 16 18:32 Music
drwxr-xr-x 2 sage sage    6 Aug 16 18:32 Public
drwxr-xr-x 2 sage sage    6 Aug 16 18:32 Templates
drwxr-xr-x 2 sage sage    6 Aug 16 18:32 Videos
sage@arch:~$ ls -lSr
total 8
drwxr-xr-x 2 sage sage    6 Aug 16 18:32 Videos
drwxr-xr-x 2 sage sage    6 Aug 16 18:32 Templates
drwxr-xr-x 2 sage sage    6 Aug 16 18:32 Public
drwxr-xr-x 2 sage sage    6 Aug 16 18:32 Music
drwxr-xr-x 2 sage sage    6 Aug 16 18:32 Documents
drwxr-xr-x 2 sage sage    6 Aug 16 18:32 Desktop
drwxr-xr-x 2 sage sage   79 Aug 16 20:29 Downloads
drwxr-xr-x 2 sage sage 4096 Aug 16 20:44 Pictures

Actual result: things are formatted nicely, and colored nicely, with icons, but sort in the wrong order!


❯ ls -lS
drwx------    -    - sage 16 Aug 20:38  .cache
drwxr-xr-x    -    - sage 16 Aug 19:18  .config
drwx------    -    - sage 16 Aug 18:32  .local
drwx------    -    - sage 16 Aug 18:36  .mozilla
drwxr-xr-x    -    - sage 16 Aug 18:32  Desktop
drwxr-xr-x    -    - sage 16 Aug 18:32 󰲂 Documents
drwxr-xr-x    -    - sage 16 Aug 20:29 󰉍 Downloads
drwxr-xr-x    -    - sage 16 Aug 18:32 󱍙 Music
drwxr-xr-x    -    - sage 16 Aug 20:44 󰉏 Pictures
drwxr-xr-x    -    - sage 16 Aug 18:32  Public
drwxr-xr-x    -    - sage 16 Aug 18:32  Templates
drwxr-xr-x    -    - sage 16 Aug 18:32  Videos
.rw-------   20 4.1k sage 16 Aug 20:37 󱆃 .bash_history
.rw-r--r--   21 4.1k sage 16 Aug 18:16 󱆃 .bash_logout
.rw-r--r--   57 4.1k sage 16 Aug 18:16 󱆃 .bash_profile
.rw-r--r--  172 4.1k sage 16 Aug 18:16 󱆃 .bashrc
.rw-r--r--  51k  53k sage 16 Aug 20:37  .zcompdump-arch-5.9
.r--r--r-- 119k 119k sage 16 Aug 20:37  .zcompdump-arch-5.9.zwc
.rw-------   45 4.1k sage 16 Aug 20:38 󱆃 .zsh_history
.rw-r--r--   56 4.1k sage 16 Aug 18:16 󱆃 .zshrc

~
❯ ls -lSr
drwxr-xr-x    -    - sage 16 Aug 18:32  Videos
drwxr-xr-x    -    - sage 16 Aug 18:32  Templates
drwxr-xr-x    -    - sage 16 Aug 18:32  Public
drwxr-xr-x    -    - sage 16 Aug 20:44 󰉏 Pictures
drwxr-xr-x    -    - sage 16 Aug 18:32 󱍙 Music
drwxr-xr-x    -    - sage 16 Aug 20:29 󰉍 Downloads
drwxr-xr-x    -    - sage 16 Aug 18:32 󰲂 Documents
drwxr-xr-x    -    - sage 16 Aug 18:32  Desktop
drwx------    -    - sage 16 Aug 18:36  .mozilla
drwx------    -    - sage 16 Aug 18:32  .local
drwxr-xr-x    -    - sage 16 Aug 19:18  .config
drwx------    -    - sage 16 Aug 20:38  .cache
.rw-r--r--   56 4.1k sage 16 Aug 18:16 󱆃 .zshrc
.rw-------   45 4.1k sage 16 Aug 20:38 󱆃 .zsh_history
.r--r--r-- 119k 119k sage 16 Aug 20:37  .zcompdump-arch-5.9.zwc
.rw-r--r--  51k  53k sage 16 Aug 20:37  .zcompdump-arch-5.9
.rw-r--r--  172 4.1k sage 16 Aug 18:16 󱆃 .bashrc
.rw-r--r--   57 4.1k sage 16 Aug 18:16 󱆃 .bash_profile
.rw-r--r--   21 4.1k sage 16 Aug 18:16 󱆃 .bash_logout
.rw-------   20 4.1k sage 16 Aug 20:37 󱆃 .bash_history

It also appears to apply the flag -a by default, though that's not necessarily desirable nor expected behavior. I don't know which part of cachyos-fish-config is causing this.

My attempt to solve the problem: uninstall cachyos-fish-config (not much of a solution, I know). Are you using a fish alias that I should know about? I checked:

~
❯ functions ls
# Defined via `source`
function ls --wraps='eza -al --color=always --group-directories-first --icons' --description 'alias ls=eza -al --color=always --group-directories-first --icons'
  eza -al --color=always --group-directories-first --icons $argv
        
end

I don't want to acquire the technical knowledge to understand this, but the problem goes farther than grouping directories first. I'd show you an example involving .jpg and .webp image data files, but the file names are too long to paste and contain offensive words, anyhow.

Now, I was able to resolve this with functions -e ls but then it's inconsistent with la and ll

Anyway, running sudo pacman -Rns cachyos-fish-config solves this entire issue. However, it leaves some sort of configuration file modified or present that creates an issue: logging in to the fish shell after removing cachyos-fish-config, I get the following errors:

source: Error encountered while sourcing file “/usr/share/cachyos-fish-config/cachyos-config.fish”:
source: No such file or directory
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
sage@arch ~> 

I solved that by going to config.fish and commenting out the source /usr/share/cachyos-fish-config/cachyos-config.fish line using the # character. But I think that running pacman -Rns should somehow apply this fix itself if possible. I don't understand how exactly the removal of packages works as a process, but hopefully that sort of fix is possible, or maybe it is possible to avoid applying some of these customizations in the first place so that this package won't be so tempting to remove or confusing to new users. Other than that, I think the CachyOs custom fish shell customization looks very nice, even if it is less useful than the default fish configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions