From f265307dc4cdc037c450a3d0832e448f443dfebe Mon Sep 17 00:00:00 2001 From: Linus Dierheimer Date: Sun, 19 Sep 2021 14:58:46 +0200 Subject: [PATCH] Prefer process name in terminal output --- src/modules/terminal.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/terminal.c b/src/modules/terminal.c index 0bdb88f6d..035d9e585 100644 --- a/src/modules/terminal.c +++ b/src/modules/terminal.c @@ -20,7 +20,12 @@ void ffPrintTerminal(FFinstance* instance) if(instance->config.terminalFormat.length == 0) { ffPrintLogoAndKey(instance, FF_TERMINAL_MODULE_NAME, 0, &instance->config.terminalKey); - puts(result->terminalExeName); + + uint32_t terminalExeNameLength = result->terminalExe.chars + result->terminalExe.length - result->terminalExeName; + if(strncmp(result->terminalExeName, result->terminalProcessName.chars, terminalExeNameLength) == 0) // if exeName starts with processName, print it. Otherwise print processName + puts(result->terminalExeName); + else + ffStrbufPutTo(&result->terminalProcessName, stdout); } else {