]> granicus.if.org Git - procps-ng/commit
w: Adjust command width
authorCraig Small <csmall@enc.com.au>
Tue, 21 Jul 2015 12:45:02 +0000 (22:45 +1000)
committerCraig Small <csmall@enc.com.au>
Tue, 21 Jul 2015 12:45:02 +0000 (22:45 +1000)
commit151c05b4978b2022eda1d6e509e65f74eb491312
tree7624a77cb839f0c3ce7035a622b4ea95e60fe3d6
parent857bb39d31e55df015d0b73913a09be847a2f8e7
w: Adjust command width

w would error out if the window size was smaller than 71 or some
other fields through environment grew too big. The code was a little
convoluted as well. The minimum length for command was 3, which is
pretty useless.

This change does the following:
 w doesn't care by default the window size
 w will adjust the command length up and down, to a minimum of 7
characters.
 if the fields don't fit, w will line-wrap each line.

The idea being its better the line-wrap than it is to error out.

References: https://bugs.debian.org/183394

Signed-off-by: Craig Small <csmall@enc.com.au>
w.c