]> git.proxmox.com Git - mirror_iproute2.git/commit
ss: use compact output for undetected screen width
authorPeter Junos <petoju@gmail.com>
Thu, 26 Dec 2019 13:07:09 +0000 (14:07 +0100)
committerDavid Ahern <dsahern@gmail.com>
Thu, 2 Jan 2020 18:38:08 +0000 (18:38 +0000)
commitc4f58629945898722ad9078e0f407c96f1ec7d2b
tree3cf614146a87c69d948a91d4a8f28fcf599eec64
parent404f2de114f24c03677e441d9e5ce589e45a6527
ss: use compact output for undetected screen width

This change fixes calculation of width in case user pipes the output.

SS output output works correctly when stdout is a terminal. When one
pipes the output, it tries to use 80 or 160 columns. That adds a
line-break if user has terminal width of 100 chars and output is of
the similar width. No width is assumed here.

To reproduce the issue, call
ss | less
and see every other line empty if your screen is between 80 and 160
columns wide.

This second version of the patch fixes screen_width being set to arbitrary
value.

Signed-off-by: Peter Junos <petoju@gmail.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
misc/ss.c