Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Apr 2019 23:48:51 +0200
From:      Polytropon <freebsd@edvax.de>
To:        "@lbutlr" <kremels@kreme.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Column widths FROM / WHAT in w(1)
Message-ID:  <20190406234851.f2fa5b35.freebsd@edvax.de>
In-Reply-To: <82580E12-C2F5-45FB-AAFC-8538B5CE0FCD@kreme.com>
References:  <20190406153319.36f41b8f.freebsd@edvax.de> <82580E12-C2F5-45FB-AAFC-8538B5CE0FCD@kreme.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 6 Apr 2019 14:58:23 -0600, @lbutlr wrote:
> On 6 Apr 2019, at 07:33, Polytropon <freebsd@edvax.de> wrote:
> > 
> > System: FreeBSD 12.0-p3 i386.
> > 
> > I recently discovered that the WHAT column in the output
> > of the "w" command has become unusable, and "man w" does
> > not seem to indicate any user control for the formatting
> > of the columns.
> > 
> > The column WHAT now can only show up to 3 (in words: three)
> > characters on a standard 80-column terminal. I will put a
> 
> How long has it been since an 80 column terminal was standard?

That doesn't matter. Terminal width has implications on how
you code (yes, really!) and how you process (read) things.
For example, why do you think your everyday newspaper has
several columns for text instead of having long text spanning
the full page width?



> > ruler on top for illustration:
> > 
> > ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
> > USER       TTY      FROM                                      LOGIN@  IDLE WHAT
> > 
> > Things like "xinit" become "xin", and any longer command
> > cannot be easily identified anymore. Columns 79 and 80
> > aren't used at all.
> > 
> > For comparison: On an older system, I get this layout:
> > 
> > ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
> > USER             TTY      FROM              LOGIN@  IDLE WHAT
> > 
> > This is more than 20 characters for the WHAT field.
> 
> Does it depend on the contents of "From"? Hmm, no, it doesn't seem too.

Yes, I already checked this. Even with short text entries
such as "-" or ":0" the column is that wide.



> however, I will say that getting the from field cut-off in
> `w` is a lot more of an issue than the WHAT column, I think.

There is a preference in seeing all relevant information
to a degree where it is understandable (or can be used to
decide if more precise information is needed, usually from
other programs). That "overview" function of the w command
is very useful (or at least, has been, before "xin", "mce",
and other abbreviated things...



> You could always output as json or xml and do your own thing.

Yes, I've seen that in the manual and tried it, but it does
not seem to contain the full information either.

Example:

	WHAT
	xin 
	les 
	/us

If processed with "w --libxo json", the following information
can be obtained from the "command" field:

	xin (xinit)
	les (less)	-> filename missing	less /COPYRIGHT
	/us (xzgv)	-> full path missing	/usr/local/bin/xzgv

So the information isn't just displayed incompletely when the
terminal width is "insufficient", its export to an external
format is also _not_ working (independently).

My assumption: Even if it cannot be displayed, it should be
exported. But no.

With a width of about 150 columns, the information is there:

	WHAT
	xinit /home/poly/.xinitrc -- /usr/local/bin/X :0 -auth /home/poly/.serverauth.1132
	less /COPYRIGHT
	/usr/local/bin/xzgv

But with such a wide terminal, coding is terrible, and the
reduction in font size makes reading even more inconvenient.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190406234851.f2fa5b35.freebsd>