aboutsummaryrefslogtreecommitdiff
path: root/overlays/patches/htop/0001-htop-untruncated-username.patch
blob: 1456cf043622eba30fb12f95592c21888bf38e99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
From: Alyssa Ross <hi@alyssa.is>
Subject: [PATCH v2] Make "spacekookie" fit untruncated as a user name
Date: Fri, 15 Mar 2019 18:18:22 +0000

---
This version of the increases the length of the column header as well as
the values, so columns after USER don't have misaligned headers.

 Process.c                          | 10 +++++-----
 darwin/Platform.c                  |  2 +-
 dragonflybsd/DragonFlyBSDProcess.c |  2 +-
 freebsd/FreeBSDProcess.c           |  2 +-
 linux/LinuxProcess.c               |  2 +-
 openbsd/OpenBSDProcess.c           |  2 +-
 solaris/SolarisProcess.c           |  2 +-
 unsupported/Platform.c             |  2 +-
 8 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/Process.c b/Process.c
index 54c41af..41d30a3 100644
--- a/Process.c
+++ b/Process.c
@@ -480,13 +480,13 @@ void Process_writeField(Process* this, RichString* str, ProcessField field) {
       if (Process_getuid != (int) this->st_uid)
          attr = CRT_colors[PROCESS_SHADOW];
       if (this->user) {
-         xSnprintf(buffer, n, "%-9s ", this->user);
+         xSnprintf(buffer, n, "%-11s ", this->user);
       } else {
-         xSnprintf(buffer, n, "%-9d ", this->st_uid);
+         xSnprintf(buffer, n, "%-11d ", this->st_uid);
       }
-      if (buffer[9] != '\0') {
-         buffer[9] = ' ';
-         buffer[10] = '\0';
+      if (buffer[11] != '\0') {
+         buffer[11] = ' ';
+         buffer[12] = '\0';
       }
       break;
    }
diff --git a/darwin/Platform.c b/darwin/Platform.c
index 1dce8b6..d603fd2 100644
--- a/darwin/Platform.c
+++ b/darwin/Platform.c
@@ -93,7 +93,7 @@ ProcessFieldData Process_fields[] = {
    [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, },
    [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, },
    [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, },
-   [USER] = { .name = "USER", .title = "USER      ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, },
+   [USER] = { .name = "USER", .title = "USER        ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, },
    [TIME] = { .name = "TIME", .title = "  TIME+  ", .description = "Total time the process has spent in user and system time", .flags = 0, },
    [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, },
    [TGID] = { .name = "TGID", .title = "   TGID ", .description = "Thread group ID (i.e. process ID)", .flags = 0, },
diff --git a/dragonflybsd/DragonFlyBSDProcess.c b/dragonflybsd/DragonFlyBSDProcess.c
index dade106..19d075d 100644
--- a/dragonflybsd/DragonFlyBSDProcess.c
+++ b/dragonflybsd/DragonFlyBSDProcess.c
@@ -77,7 +77,7 @@ ProcessFieldData Process_fields[] = {
    [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, },
    [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, },
    [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, },
-   [USER] = { .name = "USER", .title = "USER      ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, },
+   [USER] = { .name = "USER", .title = "USER        ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, },
    [TIME] = { .name = "TIME", .title = "  TIME+  ", .description = "Total time the process has spent in user and system time", .flags = 0, },
    [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, },
    [TGID] = { .name = "TGID", .title = "   TGID ", .description = "Thread group ID (i.e. process ID)", .flags = 0, },
diff --git a/freebsd/FreeBSDProcess.c b/freebsd/FreeBSDProcess.c
index f81fadf..1ed6c2a 100644
--- a/freebsd/FreeBSDProcess.c
+++ b/freebsd/FreeBSDProcess.c
@@ -76,7 +76,7 @@ ProcessFieldData Process_fields[] = {
    [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, },
    [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, },
    [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, },
-   [USER] = { .name = "USER", .title = "USER      ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, },
+   [USER] = { .name = "USER", .title = "USER        ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, },
    [TIME] = { .name = "TIME", .title = "  TIME+  ", .description = "Total time the process has spent in user and system time", .flags = 0, },
    [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, },
    [TGID] = { .name = "TGID", .title = "   TGID ", .description = "Thread group ID (i.e. process ID)", .flags = 0, },
diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c
index 5f69707..1288155 100644
--- a/linux/LinuxProcess.c
+++ b/linux/LinuxProcess.c
@@ -206,7 +206,7 @@ ProcessFieldData Process_fields[] = {
    [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, },
    [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, },
    [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, },
-   [USER] = { .name = "USER", .title = "USER      ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, },
+   [USER] = { .name = "USER", .title = "USER        ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, },
    [TIME] = { .name = "TIME", .title = "  TIME+  ", .description = "Total time the process has spent in user and system time", .flags = 0, },
    [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, },
    [TGID] = { .name = "TGID", .title = "   TGID ", .description = "Thread group ID (i.e. process ID)", .flags = 0, },
diff --git a/openbsd/OpenBSDProcess.c b/openbsd/OpenBSDProcess.c
index 70f9653..ed90cf2 100644
--- a/openbsd/OpenBSDProcess.c
+++ b/openbsd/OpenBSDProcess.c
@@ -150,7 +150,7 @@ ProcessFieldData Process_fields[] = {
       .flags = 0, },
    [USER] = {
       .name = "USER",
-      .title = "USER      ",
+      .title = "USER        ",
       .description = "Username of the process owner (or user ID if name cannot be determined)",
       .flags = 0, },
    [TIME] = {
diff --git a/solaris/SolarisProcess.c b/solaris/SolarisProcess.c
index 31f488e..7452e94 100644
--- a/solaris/SolarisProcess.c
+++ b/solaris/SolarisProcess.c
@@ -93,7 +93,7 @@ ProcessFieldData Process_fields[] = {
    [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, },
    [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, },
    [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, },
-   [USER] = { .name = "USER", .title = "USER      ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, },
+   [USER] = { .name = "USER", .title = "USER        ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, },
    [TIME] = { .name = "TIME", .title = "  TIME+  ", .description = "Total time the process has spent in user and system time", .flags = 0, },
    [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, },
    [TGID] = { .name = "TGID", .title = "   TGID ", .description = "Thread group ID (i.e. process ID)", .flags = 0, },
diff --git a/unsupported/Platform.c b/unsupported/Platform.c
index ba84419..cf5b09d 100644
--- a/unsupported/Platform.c
+++ b/unsupported/Platform.c
@@ -53,7 +53,7 @@ ProcessFieldData Process_fields[] = {
    [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, },
    [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, },
    [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, },
-   [USER] = { .name = "USER", .title = "USER      ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, },
+   [USER] = { .name = "USER", .title = "USER        ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, },
    [TIME] = { .name = "TIME", .title = "  TIME+  ", .description = "Total time the process has spent in user and system time", .flags = 0, },
    [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, },
    [TGID] = { .name = "TGID", .title = "   TGID ", .description = "Thread group ID (i.e. process ID)", .flags = 0, },
--
2.19.2