antonmedv / walk

Terminal file manager
MIT License
3.25k stars 89 forks source link

Ordering of files/folders #101

Open dylandhall opened 1 year ago

dylandhall commented 1 year ago

Looking in the code there's a comment suggesting the files/folders come pre-ordered from the OS but the ordering seems strange.

It seems to be alphabetical, but with all capital letters being ranked higher than lower case letters..

Powershell in windows: image

Bash in ubuntu (WSL2): image

At least it's consistent but it might be nice to optionally allow internal sorting, making it case insensitive.

Just to add to this, I'd also prefer to see folders above files, but that's a nice-to-have

antonmedv commented 1 year ago

We can add such option.

atb85 commented 1 year ago

We can add such option. Hi @antonmedv, I have added this enhancement and submitted a PR.

dylandhall commented 1 year ago

looks like the PR was closed without merge or comment?

pcause commented 1 month ago

perhaps use the same command line switches that eza uses?? Allows users to easily switch or co-exist. here is the --sort option from the eza man page:

Which field to sort by.

Valid sort fields are name',Name', extension',Extension', size',modified', changed',accessed', created',inode', type', andnone'.

The modified sort field has the aliases date',time', and newest', and its reverse order has the aliasesage' and `oldest'.

Sort fields starting with a capital letter will sort uppercase before lowercase: A' thenB' then a' thenb'. Fields starting with a lowercase letter will mix them: A' thena' then B' thenb'.