Skip to content

Commit 8c99683

Browse files
jan-konczak-cs-putBenBE
authored andcommitted
Fix custom thread name display issue
Fixes hishamhm#877
1 parent 265a7b8 commit 8c99683

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Process.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ void Process_makeCommandStr(Process* this) {
417417
return;
418418
if (this->state == ZOMBIE && !this->mergedCommand.str)
419419
return;
420-
if (Process_isUserlandThread(this) && settings->showThreadNames && (showThreadNames == mc->prevShowThreadNames))
420+
if (Process_isUserlandThread(this) && settings->showThreadNames && (showThreadNames == mc->prevShowThreadNames) && (mc->prevMergeSet == showMergedCommand))
421421
return;
422422

423423
/* this->mergedCommand.str needs updating only if its state or contents changed.
@@ -516,11 +516,14 @@ void Process_makeCommandStr(Process* this) {
516516
assert(cmdlineBasenameStart <= (int)strlen(cmdline));
517517

518518
if (!showMergedCommand || !procExe || !procComm) { /* fall back to cmdline */
519-
if (showMergedCommand && (!Process_isUserlandThread(this) || showThreadNames) && !procExe && procComm && strlen(procComm)) { /* Prefix column with comm */
519+
if ((showMergedCommand || (Process_isUserlandThread(this) && showThreadNames)) && procComm && strlen(procComm)) { /* set column to or prefix it with comm */
520520
if (strncmp(cmdline + cmdlineBasenameStart, procComm, MINIMUM(TASK_COMM_LEN - 1, strlen(procComm))) != 0) {
521521
WRITE_HIGHLIGHT(0, strlen(procComm), commAttr, CMDLINE_HIGHLIGHT_FLAG_COMM);
522522
str = stpcpy(str, procComm);
523523

524+
if(!showMergedCommand)
525+
return;
526+
524527
WRITE_SEPARATOR;
525528
}
526529
}

0 commit comments

Comments
 (0)