]> granicus.if.org Git - procps-ng/commitdiff
top: extend new 'X' command to include the TTY field
authorJim Warner <james.warner@comcast.net>
Tue, 25 Sep 2012 06:01:01 +0000 (01:01 -0500)
committerCraig Small <csmall@enc.com.au>
Tue, 2 Oct 2012 10:56:40 +0000 (20:56 +1000)
I have no idea what the maximum length of a terminal
name might be.  However, the library provides for up
to 128 characters (ouch).

So just to be safe, this commit extends the ability
to widen columns to embrace this field.

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.1
top/top.c

index 752f0a5e310bca98be7abfdee148bb7f2059c93c..4b3f02cbe5b5af584481dc1cc63294392e2c70fa 100644 (file)
--- a/top/top.1
+++ b/top/top.1
@@ -978,6 +978,7 @@ This \*(CI can be used to alter the widths for the following fields:
     RUID      5       RUSER     8
     SUID      5       SUSER     8
     UID       5       USER      8
+                      TTY       8
 .Ed
 
 You will be prompted for the amount to be added to the default
index 4b9667d0abacdf1fe5b17166eea62b8f40239ea5..c0c0cbf6f7e5bb63441e72ee75ddcb996b127201 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -1899,6 +1899,8 @@ static void zap_fieldstab (void) {
    Fieldstab[P_UEN].width = Fieldstab[P_URN].width
       = Fieldstab[P_USN].width = Fieldstab[P_GRP].width
       = Rc.fixed_widest ? 8 + Rc.fixed_widest : 8;
+   Fieldstab[P_TTY].width
+      = Rc.fixed_widest ? 8 + Rc.fixed_widest : 8;
 
    // lastly, ensure we've got proper column headers...
    calibrate_fields();