Subject: bug#24926: ls output has been made ugly

From: Rüdiger Meier <[email-masked]>
Date: Sat, 12 Nov 2016 13:27:35 +0100

On Friday 11 November 2016 21:00:23 Eric Blake wrote:
> On 11/11/2016 12:26 PM, Paul Eggert wrote:
> > Michael Schwager wrote:
> >> Don't you think I can see the spaces in my filenames?
> >
> > Not in general, no.  For example:
> >
> > $ ls --quoting-style=literal
> > a  b  c
> > $ ls
> > 'a  b'  c
> >
> > That being said, perhaps 'ls' could quote less aggressively.  If 'ls'
> > always arranges for at least two spaces between file names, for example,
> > 'ls' doesn't need to quote a name merely because it contains a space
> > surrounded by non-whitespace characters.  Come to think of it, 'ls -l'
> > need not quote file names containing spaces at all.
>
> If the idea is that the quoting is there to make copy-and-pasting into a
> shell command line easier, then there is nothing we can do that is less
> aggressive, since failing to quote spaces changes what the shell will
> do.  If the idea is that the quoting should only be added to avoid
> ambiguous situations, then maybe you are right that we can add further
> heuristics to the quoting algorithm to disable quotes on output that is
> unambiguous, even if it can't be pasted back into the shell.  Having two
> different quoting modes, where you can choose between the options, may
> be the way to go - but then you STILL have the problem of what to pick
> as the default of those two modes when neither one was explicitly
> requested.

The old behavior had not a problem at all. There was no need for re-thinking  
ls' purpose of existence, like "What is actually the idea of ls? ... if the 
idea is A, B or C then change X, Y or Z". What about "If most users like it 
as is then no need to change anything."?

Most other ls other implementations still do not have any problems. coreutils 
ls is now an unusual one by default. We have had many nice options to 
_enable_ and select different quoting styles. The only problem is that the 
default behavior changed. However this fact is ignored since months. Maybe 
you should add an FAQ, like:

Q: Why is ls ugly now?
A: It is not just ugly but also better! Imagine if you would like to 
copy/paste file names! It was possible in past using extra complicated 
options only but now even by default. Never thought about this? Just try to 
copy/paste, no need to read the ls output anymore. All your experience that 
ls was good as is since 20 years is wrong. BTW in the next release we will 
copy the ls output automatically into the clipboard without printing anything 
into the terminal (Then nobody can complain about ugly output anymore.)

cu,
Rudi