lsd-rs/lsd

Misleading grid / column output in some cases

Offen

#594 geöffnet am 06.12.2021

 (3 Kommentare) (1 Reaktion) (0 zugewiesene Personen)Rust (434 Forks)batch import
good first issuekind/enhancement

Repository-Metriken

Stars
 (13.400 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 34T 3h) (2 gemergte PRs in 30 T)

Beschreibung

Expected behavior

With some long filenames in a directory, columnar output (the default?) can become misleading. Would be preferable to replicate the output of GNU ls in this case. The little video below shows both the expected and actual behaviors.

Actual behavior

Please see the video. In it, file_16 goes into column 2, and off-screen (!) making it seem like there are no more files beyond file_15_....

To reproduce this, you need this:

# Set terminal window's size to 14 rows & 91 columns
$ seq -f "file_%02g" 00 16 | xargs touch
$ mv file_00 file_00_abcdefghijklmnopqrstuvwxyz_abcdefghiklmnopqrstuvwxyz
$ mv file_15 file_15_abcdefghijklmnopqrstuvwxyz_abcdefghiklmnopqrstuvwxyz

This happens at all sizes of the terminal window. I've reduced it here, to make it easier to reproduce.

https://user-images.githubusercontent.com/172235/144849060-cfcd8286-cfd1-4dde-a699-43c8e1900c28.mp4

Contributor Guide