bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#25078: ls 8.26: discrepancy between `ls' and `ls -1' in the alignmen


From: Pádraig Brady
Subject: bug#25078: ls 8.26: discrepancy between `ls' and `ls -1' in the alignment of quoted and nonquoted items
Date: Wed, 30 Nov 2016 21:35:49 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

On 30/11/16 20:19, Zhiming Wang wrote:
> coreutils 8.26 includes the following improvement:
> 
>> ls now aligns quoted items with non quoted items, which is easier to read,
>> and also better indicates that the quote is not part of the actual name.
> 
> which I find to be a welcome addition to the quoting behavior introduced in
> 8.25.

Cool, thanks.

> However, this improvement does not apply to the -1 option, which is
> puzzling to me. Compare the following (coreutils 8.26 on macOS 10.12.1,
> 80-column terminal, bash or zsh):
> 
>     $ ls
>     '['
>     'a very very very very very very very very very very very very long 
> filename'
>      b2sum
>      base32
>      base64
>      basename
> 
>     $ ls -1
>     '['
>     'a very very very very very very very very very very very very long 
> filename'
>     b2sum
>     base32
>     base64
>     basename
> 
> The second invocation with the -1 option leaves much to be desired in
> comparison to the first invocation.
> 
> -1 should probably receive the same alignment treatment?

I originally had that but thought it might be more problematic than useful.

When `ls -1` is used interactively it can be handy to triple click to
select the whole line, in which case selecting just the file name without
leading space would be preferred.

Also one can use `ls -1 | less` etc. in "interactive" mode, in which case
ls couldn't use alignment or it would break lots of scripts, but then
the output would be inconsistent if alignment was used without the pipe.

Also one can achieve the desired output with `ls -w1` or `ls -x -w1 | less`.

The arguments aren't very strong for not aligning `ls -1` by default,
so we may change this.

thanks,
Pádraig






reply via email to

[Prev in Thread] Current Thread [Next in Thread]