summaryrefslogtreecommitdiffstats
path: root/Process.c
diff options
context:
space:
mode:
authorJan Kończak <jan.konczak@cs.put.poznan.pl>2022-01-05 14:27:51 +0100
committerBenny Baumann <BenBE@geshi.org>2022-02-13 16:59:29 +0100
commit8c99683b04ca38e98b1405d63a8c83f890e05ae0 (patch)
treeb4db7d9b8b07a9015aec705055556a82ba289d28 /Process.c
parent265a7b8a501174e2f5c8268a76b5e88d6688ad70 (diff)
Fix custom thread name display issue
Fixes #877
Diffstat (limited to 'Process.c')
-rw-r--r--Process.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Process.c b/Process.c
index 3f0da978..89ccaf27 100644
--- a/Process.c
+++ b/Process.c
@@ -417,7 +417,7 @@ void Process_makeCommandStr(Process* this) {
return;
if (this->state == ZOMBIE && !this->mergedCommand.str)
return;
- if (Process_isUserlandThread(this) && settings->showThreadNames && (showThreadNames == mc->prevShowThreadNames))
+ if (Process_isUserlandThread(this) && settings->showThreadNames && (showThreadNames == mc->prevShowThreadNames) && (mc->prevMergeSet == showMergedCommand))
return;
/* this->mergedCommand.str needs updating only if its state or contents changed.
@@ -516,11 +516,14 @@ void Process_makeCommandStr(Process* this) {
assert(cmdlineBasenameStart <= (int)strlen(cmdline));
if (!showMergedCommand || !procExe || !procComm) { /* fall back to cmdline */
- if (showMergedCommand && (!Process_isUserlandThread(this) || showThreadNames) && !procExe && procComm && strlen(procComm)) { /* Prefix column with comm */
+ if ((showMergedCommand || (Process_isUserlandThread(this) && showThreadNames)) && procComm && strlen(procComm)) { /* set column to or prefix it with comm */
if (strncmp(cmdline + cmdlineBasenameStart, procComm, MINIMUM(TASK_COMM_LEN - 1, strlen(procComm))) != 0) {
WRITE_HIGHLIGHT(0, strlen(procComm), commAttr, CMDLINE_HIGHLIGHT_FLAG_COMM);
str = stpcpy(str, procComm);
+ if(!showMergedCommand)
+ return;
+
WRITE_SEPARATOR;
}
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy