Revert "Terminal (Linux): better support for tmux"

This reverts commit 281af9c86f.
This commit is contained in:
李通洲
2023-10-24 10:09:43 +08:00
parent 281af9c86f
commit 40e2787d94
4 changed files with 7 additions and 34 deletions
@@ -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();
@@ -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;
@@ -366,8 +366,6 @@ const FFTerminalShellResult* ffDetectTerminalShell(void)
}
init = true;
ffStrbufInit(&result.terminalPlugins);
ffStrbufInit(&result.shellProcessName);
ffStrbufInitA(&result.shellExe, 128);
result.shellExeName = "";