Column widths FROM / WHAT in w(1)

Christian Barthel bch at
Thu Apr 11 09:09:30 UTC 2019

Polytropon <freebsd at> writes:

> Any idea on how to get the old layout of w back, instead
> of increasing the terminal width?

w(1) is using ioctl's to determine the column width of the
terminal.  Other tools like ps (-w) and top can be configured to
change the column width.  On Linux, it seems that the variable
COLUMN allows overriding it.

Attached is a small patch that would add an environment check on
the COLUMN variable.  Further processing would be possible then,
# COLUMN=180 ./w |sed 1d| cut -c 76-            
tmux: client (/tmp//tmux-1000/default) (tmux)
cut -c 76-
-tcsh (tcsh)

I am not sure if there is another way to change the perceived
column width in w(1).

Christian Barthel <bch at>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: column_in_w.patch
Type: text/x-diff
Size: 869 bytes
Desc: not available
URL: <>

More information about the freebsd-questions mailing list