lsd-rs / lsd

The next gen ls command
Apache License 2.0
12.8k stars 413 forks source link

File list is totally vertical if the list doesn't fit into one line unless run with `-a` #1014

Closed Un1q32 closed 3 months ago

Un1q32 commented 3 months ago

Expected behavior

Wrapping behavior should be the same as 1.0.0, or the same as when run with -a

Actual behavior

Screenshot 2024-03-22 at 5 29 28 PM

Zooming in shows a normal run can also have this problem if one line isnt enough to fit

Screenshot 2024-03-22 at 5 30 40 PM
wwwjfy commented 3 months ago

It seems -a doesn't matter (much) here. My observation is if non-. items cannot fit in one line, it'll show one item per line.

In the above case non-. items are not many, so even though with both it's wider than one line, it still behaves as expected.

I'm using iTerm2. This is new in the last release.

nogweii commented 3 months ago

Running into the same issue.

I've aliased ls to /usr/bin/lsd --icon=auto --color=auto -F, and indeed adding -a will make files wrap as expected.

zwpaper commented 3 months ago

it was introduced because we upgraded the term_grid = "0.1.*" dependency to the newer version, let me have a look at it.

oneElectron commented 3 months ago

I am also having this issue.

FischLu commented 3 months ago

I have the same issue

nogweii commented 3 months ago

Hm, I think I've found the root cause - term_grid doesn't ignore ANSI codes when calculating the width of each entry. That could be tricky to solve...

EDIT: Ah, actually there's a more maintained fork of the library at https://github.com/uutils/uutils-term-grid ! And it does properly ignore ANSI codes.

CarloCattano commented 3 months ago

came here looking for others having the same. lsd 1.1.1

ls returns a vertical list of files if the size cant hold them all in one line

zwpaper commented 3 months ago

I decided to rollback the term_grid dependency and we can later discuss which version or libs we should upgrade to.

https://github.com/lsd-rs/lsd/pull/1019, after this one is merged, I will release a v1.1.2 to do a quick fix.

sorry for the bothering, I was kinda busy recently, but this should not be an excuse

zwpaper commented 3 months ago

as now https://github.com/lsd-rs/lsd/releases/tag/v1.1.2 released, this would be close /close

muniu-bot[bot] commented 3 months ago

@zwpaper: Closing this issue.

In response to [this](https://github.com/lsd-rs/lsd/issues/1014#issuecomment-2018425213): >as now https://github.com/lsd-rs/lsd/releases/tag/v1.1.2 released, this would be close >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.