diff --git a/AvailableColumnsPanel.c b/AvailableColumnsPanel.c index 545ef7d78..eef0542f9 100644 --- a/AvailableColumnsPanel.c +++ b/AvailableColumnsPanel.c @@ -104,7 +104,7 @@ static void AvailableColumnsPanel_addDynamicColumns(AvailableColumnsPanel* this, // Handle remaining Platform Meter entries in the AvailableColumnsPanel static void AvailableColumnsPanel_addPlatformColumns(AvailableColumnsPanel* this) { for (int i = 1; i < LAST_PROCESSFIELD; i++) { - if (i != COMM && Process_fields[i].description) { + if (Process_fields[i].description) { char description[256]; xSnprintf(description, sizeof(description), "%s - %s", Process_fields[i].name, Process_fields[i].description); Panel_add(&this->super, (Object*) ListItem_new(description, i)); diff --git a/ColumnsPanel.c b/ColumnsPanel.c index 66625666d..d0922563b 100644 --- a/ColumnsPanel.c +++ b/ColumnsPanel.c @@ -47,7 +47,7 @@ static HandlerResult ColumnsPanel_eventHandler(Panel* super, int ch) { case KEY_ENTER: case KEY_MOUSE: case KEY_RECLICK: - if (selected < size - 1) { + if (selected < size) { this->moving = !(this->moving); Panel_setSelectionColor(super, this->moving ? PANEL_SELECTION_FOLLOW : PANEL_SELECTION_FOCUS); ListItem* selectedItem = (ListItem*) Panel_getSelected(super); @@ -63,7 +63,7 @@ static HandlerResult ColumnsPanel_eventHandler(Panel* super, int ch) { case KEY_F(7): case '[': case '-': - if (selected < size - 1) + if (selected < size) Panel_moveSelectedUp(super); result = HANDLED; break; @@ -74,13 +74,13 @@ static HandlerResult ColumnsPanel_eventHandler(Panel* super, int ch) { case KEY_F(8): case ']': case '+': - if (selected < size - 2) + if (selected < size - 1) Panel_moveSelectedDown(super); result = HANDLED; break; case KEY_F(9): case KEY_DC: - if (selected < size - 1) + if (size > 1 && selected < size) Panel_remove(super, selected); result = HANDLED; break; diff --git a/darwin/DarwinProcess.c b/darwin/DarwinProcess.c index 717e467f5..2ef497a45 100644 --- a/darwin/DarwinProcess.c +++ b/darwin/DarwinProcess.c @@ -23,7 +23,7 @@ in the source distribution for its full text. const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, }, [PID] = { .name = "PID", .title = "PID", .description = "Process/thread ID", .flags = 0, .pidColumn = true, }, - [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, }, + [COMM] = { .name = "Command", .title = "Command ", .description = "Command line (insert as last column only)", .flags = 0, }, [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping, R running, D disk, Z zombie, T traced, W paging)", .flags = 0, }, [PPID] = { .name = "PPID", .title = "PPID", .description = "Parent process ID", .flags = 0, .pidColumn = true, }, [PGRP] = { .name = "PGRP", .title = "PGRP", .description = "Process group ID", .flags = 0, .pidColumn = true, }, diff --git a/dragonflybsd/DragonFlyBSDProcess.c b/dragonflybsd/DragonFlyBSDProcess.c index 002378a77..1c58434f7 100644 --- a/dragonflybsd/DragonFlyBSDProcess.c +++ b/dragonflybsd/DragonFlyBSDProcess.c @@ -21,7 +21,7 @@ in the source distribution for its full text. const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, }, [PID] = { .name = "PID", .title = "PID", .description = "Process/thread ID", .flags = 0, .pidColumn = true, }, - [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, }, + [COMM] = { .name = "Command", .title = "Command ", .description = "Command line (insert as last column only)", .flags = 0, }, [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping (<20s), I Idle, Q Queued for Run, R running, D disk, Z zombie, T traced, W paging, B Blocked, A AskedPage, C Core, J Jailed)", .flags = 0, }, [PPID] = { .name = "PPID", .title = "PPID", .description = "Parent process ID", .flags = 0, .pidColumn = true, }, [PGRP] = { .name = "PGRP", .title = "PGRP", .description = "Process group ID", .flags = 0, .pidColumn = true, }, diff --git a/freebsd/FreeBSDProcess.c b/freebsd/FreeBSDProcess.c index 9ae81e1d4..bdbf02527 100644 --- a/freebsd/FreeBSDProcess.c +++ b/freebsd/FreeBSDProcess.c @@ -24,7 +24,7 @@ const char* const nodevStr = "nodev"; const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, }, [PID] = { .name = "PID", .title = "PID", .description = "Process/thread ID", .flags = 0, .pidColumn = true, }, - [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, }, + [COMM] = { .name = "Command", .title = "Command ", .description = "Command line (insert as last column only)", .flags = 0, }, [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping, R running, D disk, Z zombie, T traced, W paging)", .flags = 0, }, [PPID] = { .name = "PPID", .title = "PPID", .description = "Parent process ID", .flags = 0, .pidColumn = true, }, [PGRP] = { .name = "PGRP", .title = "PGRP", .description = "Process group ID", .flags = 0, .pidColumn = true, }, diff --git a/htop.1.in b/htop.1.in index 70334f9b7..b5d17171e 100644 --- a/htop.1.in +++ b/htop.1.in @@ -298,6 +298,9 @@ is active, the executable path (/proc/[pid]/exe) and the command name The program basename is highlighted if set in the configuration. Additional highlighting can be configured for stale executables (cf. EXE column below). + +The Command column should be the last column in each screen as can get very long +and profits from being able to extend its length dynamically. .TP .B COMM The command name of the process obtained from /proc/[pid]/comm, if readable. diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c index e70d7d0c9..3d58ed54c 100644 --- a/linux/LinuxProcess.c +++ b/linux/LinuxProcess.c @@ -34,7 +34,7 @@ in the source distribution for its full text. const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, }, [PID] = { .name = "PID", .title = "PID", .description = "Process/thread ID", .flags = 0, .pidColumn = true, }, - [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, }, + [COMM] = { .name = "Command", .title = "Command ", .description = "Command line (insert as last column only)", .flags = 0, }, [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping, R running, D disk, Z zombie, T traced, W paging, I idle)", .flags = 0, }, [PPID] = { .name = "PPID", .title = "PPID", .description = "Parent process ID", .flags = 0, .pidColumn = true, }, [PGRP] = { .name = "PGRP", .title = "PGRP", .description = "Process group ID", .flags = 0, .pidColumn = true, }, diff --git a/netbsd/NetBSDProcess.c b/netbsd/NetBSDProcess.c index 5462e721a..8d4a931a4 100644 --- a/netbsd/NetBSDProcess.c +++ b/netbsd/NetBSDProcess.c @@ -37,7 +37,7 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { [COMM] = { .name = "Command", .title = "Command ", - .description = "Command line", + .description = "Command line (insert as last column only)", .flags = 0, }, [STATE] = { diff --git a/openbsd/OpenBSDProcess.c b/openbsd/OpenBSDProcess.c index 7f50b0f8d..ec6530ef5 100644 --- a/openbsd/OpenBSDProcess.c +++ b/openbsd/OpenBSDProcess.c @@ -35,7 +35,7 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { [COMM] = { .name = "Command", .title = "Command ", - .description = "Command line", + .description = "Command line (insert as last column only)", .flags = 0, }, [STATE] = { diff --git a/pcp/PCPProcess.c b/pcp/PCPProcess.c index e8cc1aade..440b05a09 100644 --- a/pcp/PCPProcess.c +++ b/pcp/PCPProcess.c @@ -28,7 +28,7 @@ in the source distribution for its full text. const ProcessFieldData Process_fields[] = { [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, }, [PID] = { .name = "PID", .title = "PID", .description = "Process/thread ID", .flags = 0, .pidColumn = true, }, - [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, }, + [COMM] = { .name = "Command", .title = "Command ", .description = "Command line (insert as last column only)", .flags = 0, }, [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping, R running, D disk, Z zombie, T traced, W paging, I idle)", .flags = 0, }, [PPID] = { .name = "PPID", .title = "PPID", .description = "Parent process ID", .flags = 0, }, [PGRP] = { .name = "PGRP", .title = "PGRP", .description = "Process group ID", .flags = 0, }, diff --git a/solaris/SolarisProcess.c b/solaris/SolarisProcess.c index 29e981dff..007fd1938 100644 --- a/solaris/SolarisProcess.c +++ b/solaris/SolarisProcess.c @@ -24,7 +24,7 @@ in the source distribution for its full text. const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, }, [PID] = { .name = "PID", .title = "PID", .description = "Process/thread ID", .flags = 0, .pidColumn = true, }, - [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, }, + [COMM] = { .name = "Command", .title = "Command ", .description = "Command line (insert as last column only)", .flags = 0, }, [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping, R running, O onproc, Z zombie, T stopped, W waiting)", .flags = 0, }, [PPID] = { .name = "PPID", .title = "PPID", .description = "Parent process ID", .flags = 0, .pidColumn = true, }, [PGRP] = { .name = "PGRP", .title = "PGRP", .description = "Process group ID", .flags = 0, .pidColumn = true, }, diff --git a/unsupported/UnsupportedProcess.c b/unsupported/UnsupportedProcess.c index 0eb6ce937..acb807847 100644 --- a/unsupported/UnsupportedProcess.c +++ b/unsupported/UnsupportedProcess.c @@ -18,7 +18,7 @@ in the source distribution for its full text. const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, }, [PID] = { .name = "PID", .title = "PID", .description = "Process/thread ID", .flags = 0, .pidColumn = true, }, - [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, }, + [COMM] = { .name = "Command", .title = "Command ", .description = "Command line (insert as last column only)", .flags = 0, }, [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping, R running, D disk, Z zombie, T traced, W paging)", .flags = 0, }, [PPID] = { .name = "PPID", .title = "PPID", .description = "Parent process ID", .flags = 0, .pidColumn = true, }, [PGRP] = { .name = "PGRP", .title = "PGRP", .description = "Process group ID", .flags = 0, .pidColumn = true, },