parent
6dcad92b3a
commit
410e5e4f95
@ -1,136 +1,124 @@ |
||||
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
|
||||
Subject: [PATCH htop v3] Make "spacekookie" fit untruncated as a user name
|
||||
Date: Fri, 26 Feb 2021 16:14:13 +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.
|
||||
Fixed for latest htop (3.0.5).
|
||||
|
||||
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(-)
|
||||
Process.c | 2 +-
|
||||
darwin/DarwinProcess.c | 2 +-
|
||||
dragonflybsd/DragonFlyBSDProcess.c | 2 +-
|
||||
freebsd/FreeBSDProcess.c | 2 +-
|
||||
linux/LinuxProcess.c | 2 +-
|
||||
openbsd/OpenBSDProcess.c | 2 +-
|
||||
solaris/SolarisProcess.c | 2 +-
|
||||
unsupported/UnsupportedProcess.c | 2 +-
|
||||
8 files changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/Process.c b/Process.c
|
||||
index 54c41af..41d30a3 100644
|
||||
index a78fd23..1336897 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)
|
||||
@@ -370,7 +370,7 @@ void Process_writeField(const Process* this, RichString* str, ProcessField field
|
||||
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);
|
||||
- Process_printLeftAlignedField(str, attr, this->user, 9);
|
||||
+ Process_printLeftAlignedField(str, attr, this->user, 11);
|
||||
return;
|
||||
}
|
||||
- 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, },
|
||||
|
||||
diff --git a/darwin/DarwinProcess.c b/darwin/DarwinProcess.c
|
||||
index bedfefe..0db854e 100644
|
||||
--- a/darwin/DarwinProcess.c
|
||||
+++ b/darwin/DarwinProcess.c
|
||||
@@ -40,7 +40,7 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
|
||||
[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, },
|
||||
[TGID] = { .name = "TGID", .title = "TGID", .description = "Thread group ID (i.e. process ID)", .flags = 0, .pidColumn = true, },
|
||||
diff --git a/dragonflybsd/DragonFlyBSDProcess.c b/dragonflybsd/DragonFlyBSDProcess.c
|
||||
index dade106..19d075d 100644
|
||||
index 15b1a69..b176d5b 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, },
|
||||
@@ -40,7 +40,7 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
|
||||
[PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, },
|
||||
[PERCENT_NORM_CPU] = { .name = "PERCENT_NORM_CPU", .title = "NCPU%", .description = "Normalized percentage of the CPU time the process used in the last sampling (normalized by cpu count)", .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, },
|
||||
[TGID] = { .name = "TGID", .title = "TGID", .description = "Thread group ID (i.e. process ID)", .flags = 0, .pidColumn = true, },
|
||||
diff --git a/freebsd/FreeBSDProcess.c b/freebsd/FreeBSDProcess.c
|
||||
index f81fadf..1ed6c2a 100644
|
||||
index 28d482e..726afcd 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, },
|
||||
@@ -41,7 +41,7 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
|
||||
[PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, },
|
||||
[PERCENT_NORM_CPU] = { .name = "PERCENT_NORM_CPU", .title = "NCPU%", .description = "Normalized percentage of the CPU time the process used in the last sampling (normalized by cpu count)", .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, },
|
||||
[TGID] = { .name = "TGID", .title = "TGID", .description = "Thread group ID (i.e. process ID)", .flags = 0, .pidColumn = true, },
|
||||
diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c
|
||||
index 5f69707..1288155 100644
|
||||
index ce6d34d..3bb1143 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, },
|
||||
@@ -63,7 +63,7 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
|
||||
[PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, },
|
||||
[PERCENT_NORM_CPU] = { .name = "PERCENT_NORM_CPU", .title = "NCPU%", .description = "Normalized percentage of the CPU time the process used in the last sampling (normalized by cpu count)", .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, },
|
||||
[TGID] = { .name = "TGID", .title = "TGID", .description = "Thread group ID (i.e. process ID)", .flags = 0, .pidColumn = true, },
|
||||
diff --git a/openbsd/OpenBSDProcess.c b/openbsd/OpenBSDProcess.c
|
||||
index 70f9653..ed90cf2 100644
|
||||
index 00aea63..ae66bd5 100644
|
||||
--- a/openbsd/OpenBSDProcess.c
|
||||
+++ b/openbsd/OpenBSDProcess.c
|
||||
@@ -150,7 +150,7 @@ ProcessFieldData Process_fields[] = {
|
||||
.flags = 0, },
|
||||
@@ -150,7 +150,7 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
|
||||
},
|
||||
[USER] = {
|
||||
.name = "USER",
|
||||
- .title = "USER ",
|
||||
+ .title = "USER ",
|
||||
.description = "Username of the process owner (or user ID if name cannot be determined)",
|
||||
.flags = 0, },
|
||||
[TIME] = {
|
||||
.flags = 0,
|
||||
},
|
||||
diff --git a/solaris/SolarisProcess.c b/solaris/SolarisProcess.c
|
||||
index 31f488e..7452e94 100644
|
||||
index d905f7a..d608c2d 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, },
|
||||
@@ -40,7 +40,7 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
|
||||
[PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, },
|
||||
[PERCENT_NORM_CPU] = { .name = "PERCENT_NORM_CPU", .title = "NCPU%", .description = "Normalized percentage of the CPU time the process used in the last sampling (normalized by cpu count)", .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, },
|
||||
[TGID] = { .name = "TGID", .title = "TGID", .description = "Thread group ID (i.e. process ID)", .flags = 0, .pidColumn = true, },
|
||||
diff --git a/unsupported/UnsupportedProcess.c b/unsupported/UnsupportedProcess.c
|
||||
index eb52910..5ba591b 100644
|
||||
--- a/unsupported/UnsupportedProcess.c
|
||||
+++ b/unsupported/UnsupportedProcess.c
|
||||
@@ -31,7 +31,7 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
|
||||
[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
|
||||
|
||||
[TGID] = { .name = "TGID", .title = "TGID", .description = "Thread group ID (i.e. process ID)", .flags = 0, .pidColumn = true, },
|
||||
--
|
||||
2.30.0
|
||||
|
||||
|
Loading…
Reference in new issue