lsd-rs / lsd-rs/lsd

Sort order of non Ascii Characters

Open
#1,220 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
16.2k
Forks
510
PR merge metrics
No merged PRs in 30d

Description

Not sure, if it's more a bug report or a feature request, but the sort order of non Ascii characters could be improved. Eg:

/usr/bin/ls -l
insgesamt 0
-rw-rw---- 1 chriss chriss 0 21. Jun 14:16 Ab
-rw-rw---- 1 chriss chriss 0 21. Jun 14:16 Ac
-rw-rw---- 1 chriss chriss 0 21. Jun 14:16 Ad
-rw-rw---- 1 chriss chriss 0 21. Jun 14:16 Ae
-rw-rw---- 1 chriss chriss 0 21. Jun 14:16 Æ
-rw-rw---- 1 chriss chriss 0 21. Jun 14:28 Aei
-rw-rw---- 1 chriss chriss 0 21. Jun 14:28 Aej
-rw-rw---- 1 chriss chriss 0 21. Jun 14:27 Æj
-rw-rw---- 1 chriss chriss 0 21. Jun 14:28 Aek
-rw-rw---- 1 chriss chriss 0 21. Jun 14:16 Af
-rw-rw---- 1 chriss chriss 0 21. Jun 14:16 Ag
-rw-rw---- 1 chriss chriss 0 21. Jun 14:25 Äg
-rw-rw---- 1 chriss chriss 0 21. Jun 14:16 Ah
-rw-rw---- 1 chriss chriss 0 21. Jun 14:24 zz

the char Æ, that looks like an A and E together is sorted as Ae between Ae and Af with ls.
the char Ä is sorted like a normal A.

/usr/bin/lsd -l
.rw-rw---- chriss chriss 0 B Sun Jun 21 14:16:15 2026  Ab
.rw-rw---- chriss chriss 0 B Sun Jun 21 14:16:15 2026  Ac
.rw-rw---- chriss chriss 0 B Sun Jun 21 14:16:15 2026  Ad
.rw-rw---- chriss chriss 0 B Sun Jun 21 14:16:15 2026  Ae
.rw-rw---- chriss chriss 0 B Sun Jun 21 14:28:01 2026  Aei
.rw-rw---- chriss chriss 0 B Sun Jun 21 14:28:06 2026  Aej
.rw-rw---- chriss chriss 0 B Sun Jun 21 14:28:06 2026  Aek
.rw-rw---- chriss chriss 0 B Sun Jun 21 14:16:15 2026  Af
.rw-rw---- chriss chriss 0 B Sun Jun 21 14:16:15 2026  Ag
.rw-rw---- chriss chriss 0 B Sun Jun 21 14:16:15 2026  Ah
.rw-rw---- chriss chriss 0 B Sun Jun 21 14:24:39 2026  zz
.rw-rw---- chriss chriss 0 B Sun Jun 21 14:25:39 2026  Äg
.rw-rw---- chriss chriss 0 B Sun Jun 21 14:16:15 2026  Æ
.rw-rw---- chriss chriss 0 B Sun Jun 21 14:27:55 2026  Æj

lsd sorts both to the end.

IMHO, the behavior of ls is better in these cases.
Is this something, that could/should be improved?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported ordering with filenames containing Æ and Ä, comparing lsd's output with /usr/bin/ls. Start by locating the repository's sorting implementation and any existing sorting tests; done means non-ASCII names follow the intended ordering consistently rather than being placed at the end.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.