lsd-rs / lsd

The next gen ls command
Apache License 2.0
13.05k stars 425 forks source link

[Feature]: support `ls -w` to specify the width/columns #928

Open huyz opened 10 months ago

huyz commented 10 months ago

Version

version

❯ lsd --version
lsd 1.0.0

What OS are you seeing the problem on?

macOS

installation

brew install lsd

term

xterm-256color

ls-colors

N/A

What happened?

My terminal window is 120 characters wide.

If I do ls or lsd, then I get multiple (3) columns in my ~/git directory.

Now, if I pipe the output through less (or cat) I only get a single column.

The workaround for GNU ls is to use the -w $COLUMNS option (more conveniently defined as a shell function. The workaround for BSD ls is to export COLUMNS.

I don't think there's a workaround for lsd

What expected?

lsd should offer an option, as ls does, to preserve multiple columns even when piped.

What else?

See https://askubuntu.com/questions/89173/preserving-multi-column-output-from-ls-when-paging/89177#89177

huyz commented 10 months ago

(Btw, the "New issue" page has 2 "Bug reports" and no "Feature requests". And strangely, the "new" Bug Report form puts some of the form fields into code fences instead of being consistent and offering us full Markdown textareas)

zwpaper commented 10 months ago

puts some of the form fields into code fences instead of being consistent and offering us full Markdown textareas)

Hi @huyz, it is meant to be like this, this is a new feature of GitHub, which can help us gather more required information when users submit issues.

zwpaper commented 10 months ago

/kind feature

huyz commented 10 months ago

Hi @huyz, it is meant to be like this, this is a new feature of GitHub, which can help us gather more required information when users submit issues.

I figured it's intentional. However, I'm giving feedback that it doesn't work well. IMHO all textareas should be the same: either non-Markdown or all Markdown. Otherwise, we get surprised when the formatting comes out all wrong with no line-wrapping and unclickable links. UX fail if you ask me