diff --git a/src/detection/terminalshell/terminalshell.h b/src/detection/terminalshell/terminalshell.h index 5e9113d71..41e31700f 100644 --- a/src/detection/terminalshell/terminalshell.h +++ b/src/detection/terminalshell/terminalshell.h @@ -20,7 +20,6 @@ typedef struct FFTerminalShellResult const char* terminalExeName; //pointer to a char in terminalExe FFstrbuf terminalVersion; uint32_t terminalPid; - FFstrbuf terminalPlugins; } FFTerminalShellResult; const FFTerminalShellResult* ffDetectTerminalShell(); diff --git a/src/detection/terminalshell/terminalshell_linux.c b/src/detection/terminalshell/terminalshell_linux.c index 37ec1e87f..810fe90bc 100644 --- a/src/detection/terminalshell/terminalshell_linux.c +++ b/src/detection/terminalshell/terminalshell_linux.c @@ -176,18 +176,6 @@ static void getTerminalShell(FFTerminalShellResult* result, pid_t pid) return; } - if (ffStrStartsWith(name, "tmux: ")) - { - if (result->terminalPlugins.length) - ffStrbufAppendS(&result->terminalPlugins, ", "); - ffStrbufAppendS(&result->terminalPlugins, "tmux "); - ffStrbufAppendS(&result->terminalPlugins, getenv("TERM_PROGRAM_VERSION")); - ffStrbufTrimRight(&result->terminalPlugins, ' '); - - getTerminalShell(result, ppid); - return; - } - #ifdef __APPLE__ // https://github.com/fastfetch-cli/fastfetch/discussions/501 if (ffStrEndsWith(name, " (figterm)")) @@ -248,7 +236,8 @@ static void getTerminalFromEnv(FFTerminalShellResult* result) //Termux if(!ffStrSet(term) && ( getenv("TERMUX_VERSION") != NULL || - getenv("TERMUX_MAIN_PACKAGE_FORMAT") != NULL + getenv("TERMUX_MAIN_PACKAGE_FORMAT") != NULL || + getenv("TMUX_TMPDIR") != NULL )) term = "com.termux"; #endif @@ -343,8 +332,6 @@ const FFTerminalShellResult* ffDetectTerminalShell() const uint32_t exePathLen = 260; #endif - ffStrbufInit(&result.terminalPlugins); - ffStrbufInit(&result.shellProcessName); ffStrbufInitA(&result.shellExe, exePathLen); result.shellExeName = result.shellExe.chars; diff --git a/src/detection/terminalshell/terminalshell_windows.c b/src/detection/terminalshell/terminalshell_windows.c index ee0f287ba..ebc062b33 100644 --- a/src/detection/terminalshell/terminalshell_windows.c +++ b/src/detection/terminalshell/terminalshell_windows.c @@ -366,8 +366,6 @@ const FFTerminalShellResult* ffDetectTerminalShell(void) } init = true; - ffStrbufInit(&result.terminalPlugins); - ffStrbufInit(&result.shellProcessName); ffStrbufInitA(&result.shellExe, 128); result.shellExeName = ""; diff --git a/src/modules/terminal/terminal.c b/src/modules/terminal/terminal.c index 5f508263e..d157cec38 100644 --- a/src/modules/terminal/terminal.c +++ b/src/modules/terminal/terminal.c @@ -6,7 +6,7 @@ #include -#define FF_TERMINAL_NUM_FORMAT_ARGS 7 +#define FF_TERMINAL_NUM_FORMAT_ARGS 6 void ffPrintTerminal(FFTerminalOptions* options) { @@ -22,18 +22,10 @@ void ffPrintTerminal(FFTerminalOptions* options) { ffPrintLogoAndKey(FF_TERMINAL_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT); - ffStrbufWriteTo(&result->terminalPrettyName, stdout); - if(result->terminalVersion.length) - { - putchar(' '); - ffStrbufWriteTo(&result->terminalVersion, stdout); - } - - if(result->terminalPlugins.length) - printf(" (with %s)", result->terminalPlugins.chars); - - putchar('\n'); + printf("%s %s\n", result->terminalPrettyName.chars, result->terminalVersion.chars); + else + ffStrbufPutTo(&result->terminalPrettyName, stdout); } else { @@ -44,7 +36,6 @@ void ffPrintTerminal(FFTerminalOptions* options) {FF_FORMAT_ARG_TYPE_UINT, &result->terminalPid}, {FF_FORMAT_ARG_TYPE_STRBUF, &result->terminalPrettyName}, {FF_FORMAT_ARG_TYPE_STRBUF, &result->terminalVersion}, - {FF_FORMAT_ARG_TYPE_STRBUF, &result->terminalPlugins}, }); } } @@ -93,7 +84,6 @@ void ffGenerateTerminalJsonResult(FF_MAYBE_UNUSED FFTerminalOptions* options, yy yyjson_mut_obj_add_uint(doc, obj, "pid", result->terminalPid); yyjson_mut_obj_add_strbuf(doc, obj, "prettyName", &result->terminalPrettyName); yyjson_mut_obj_add_strbuf(doc, obj, "version", &result->terminalVersion); - yyjson_mut_obj_add_strbuf(doc, obj, "plugins", &result->terminalPlugins); } void ffPrintTerminalHelpFormat(void) @@ -104,8 +94,7 @@ void ffPrintTerminalHelpFormat(void) "Terminal exe name", "Terminal pid", "Terminal pretty name", - "Terminal version", - "Terminal plugins (e.g. tmux)" + "Terminal version" }); }