Subject: Re: bug#20442: bug+patch: du output misaligned on different terminals

From: Linda Walsh <[email-masked]>
Date: Wed, 13 May 2015 14:36:18 -0700

Pádraig Brady wrote: > There are backwards compatibility issues to
consider.

Could you demonstrate any where similar issues wouldn't affect output
from 'ls'

Second, I don't remember numfmt being part being part of posix, but my
solution seems to fall under POSIX:

From: 	Pádraig Brady 
Subject: 	Re: du: POSIX mandating a single space instead of tab?  
Date: 	Tue, 28 Apr 2015 16:51:06 +0100 
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

On 28/04/15 15:42, Eric Blake wrote:

>>> No, the space stands for any (positive) amount of white space.  
>>> http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap05.html#tag_05
>>> Andreas.
>>
>> Thanks for pointing that out Andreas.  
>> So a ' ' in a format implies any amount of blank chars.
> 
> Correct.  
> 

>> So we could separate the du columns with spaces rather than tab,

> 
> Yes, I'd prefer that we did that.  It is much easier to guarantee
> alignment when using spaces and completely avoiding whatever tab stops
> people have set up.

=====

I find myself agreeing with Eric on this issue.

Actually, I would prefer a envvar USE_TABS=[[ytfnx]] (yes true
false/no/false/no/expand) and their upper-case versions for simplicity
as defaulting to 8 space/tab -- though I could also support the absence
of 'USE_TABS' as being compatible with current functionality.

I can see the use of something like this in desktop programs tty/consoles,
editors, etc...

I would want to see standard column terminology (ala sort & cut ranging
from 1 - 80).

If the var is undefined, I think it would be _more_ _predictable_ to go go with
expanded as '8', OR with like the tty_tabs command w/no args: it shows
you the current settings.  (Why doesn't 'tabs' show them?)

However -- it we agree on the env-var for tab presence/expansion and tabstop
definitions, I could also agree on leaving behaviors in current programs the
same as they are now (w/o the USE_TABS envvar).

> tabs

tabs: no tab-list given  --- hmmm not too useful

> tabs 2 -- also tabs doesn't take columns but spaces of separation.
Tabstops are usually at set points like 1/2" or 1/4" or some fixed
number, so if I use tabs 2:, One might like 'tabs' to display the
current tabs: > tty_tab

(from 1, tabs skip to column: 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31
33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79
80 

I note the tab program also supports irregular tabs:

for i in a a2 c c2 c3 f p s u;do tabs -$i tty_tab done
                                                                       
(from 1, tabs skip to column: 10 16 36 72 80 
                                                                       
(from 1, tabs skip to column: 10 16 40 72 80 
                                                      
(from 1, tabs skip to column: 8 20 55 80 
                                                
(from 1, tabs skip to column: 6 10 14 49 80 
                                                                  
(from 1, tabs skip to column: 6 10 22 26 30 34 38 42 46 50 54 58 62 67 80 
                      
(from 1, tabs skip to column: 7 11 15 19 23 80 
                                                            
(from 1, tabs skip to column: 5 9 13 17 21 25 29 33 37 49 53 80 
                                                      
(from 1, tabs skip to column: 10 55 80 
                                           
(from 1, tabs skip to column: 12 20 44 80 

-----------------

I would like to see this in an ENV var so people could use it for
other utils in their session (like vim/emacs or whatever).

Some files like the /etc/fstab file really need variable tabs.