The alignment change is helpful, but I do have an argument against doing the same in the -1 case: It breaks something many of us have done in scripts.
Of course we *know* that ls -1 isn't the best way to go, but for quickie scripts it has been the standby for many. Also, I cannot come up with a good reason why someone would use ls -1 unless they were scripting it. (add to that, if anyone using the -1 argument that seems to imply that they know what they are doing). Having said that, I am thinking about it now an know that I have used ls-1 before just to see the output, and I used it to see the honest output without any "noise" - no dates and times, no formatting, no anything, just plain filenames. I think the "list one file per line." in the man page says it right; just list it. I understand when you say "The arguments aren't very strong for not aligning `ls -1` by default,", however I have given you one (albeit weak) argument, and for me, I cannot see a strong argument for making ls -1 align like that. As eluded to above, I cannot think of a scenario where someone would use ls -1 and want it indented for them. Cheers, Paul On Wed, Nov 30, 2016 at 4:35 PM, Pádraig Brady <[email protected]> wrote: > 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 > > > > >
