[Git][NTPsec/ntpsec][master] In ntpq, cap the peername-field width at 39.
Eric S. Raymond
gitlab at mg.gitlab.com
Sun Nov 27 03:09:24 UTC 2016
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
d4b39117 by Eric S. Raymond at 2016-11-26T22:09:14-05:00
In ntpq, cap the peername-field width at 39.
...because on very wide displays, slamming the non-hostname fields all
the way to the right produces a huge river that makes the entries
difficult to read as wholes. This choice caps the peername field
width at that of the longest possible IPV6 numeric address.
- - - - -
1 changed file:
- pylib/util.py
Changes:
=====================================
pylib/util.py
=====================================
--- a/pylib/util.py
+++ b/pylib/util.py
@@ -86,8 +86,13 @@ class PeerSummary:
# fit in 80 characters. This tells us how much extra horizontal space
# we have available on a wider terminal emulator.
self.horizontal_slack = (termwidth or 80) - 80
- # Peer spreadsheet column widths
- self.namewidth = 15 + self.horizontal_slack
+ # Peer spreadsheet column widths. The reason we cap extra
+ # width used at 24 is that on very wide displays, slamming the
+ # non-hostname fields all the way to the right produces a huge
+ # river that makes the entries difficult to read as wholes.
+ # This choice caps the peername field width at that of the longest
+ # possible IPV6 numeric address.
+ self.namewidth = 15 + min(self.horizontal_slack, 24)
self.refidwidth = 15
# Compute peer spreadsheet headers
self.__remote = " remote ".ljust(self.namewidth)
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/d4b39117c2d454a81bdc1225e5b775228ed0933f
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161127/429edc3b/attachment.html>
More information about the vc
mailing list