From 85ed4b136fd52596e4eefa3f72f92e8e832c75c4 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Mon, 10 Feb 2025 09:14:24 +0800 Subject: [PATCH] Terminal (Linux): improve performance of Tilix version detection Fix #1550 --- CHANGELOG.md | 1 + src/detection/terminalshell/terminalshell.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7ba9f4b1..68385e815 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ Features: * Support more Armbian variants detection (#1547, OS, Linux) * Support the syntax of `{$ENV_VAR}` in custom format, which will be replaced by the value of the environment variable `ENV_VAR` (#1541) * This is another way to pass 3rd-party data to fastfetch besides `Custom` module. +* Improve performance of Tilix version detection (Terminal, Linux) Logo: * Update arch_old diff --git a/src/detection/terminalshell/terminalshell.c b/src/detection/terminalshell/terminalshell.c index f29902727..21c114488 100644 --- a/src/detection/terminalshell/terminalshell.c +++ b/src/detection/terminalshell/terminalshell.c @@ -669,6 +669,12 @@ FF_MAYBE_UNUSED static bool getTerminalVersionPtyxis(FF_MAYBE_UNUSED FFstrbuf* e FF_MAYBE_UNUSED static bool getTerminalVersionTilix(FFstrbuf* exe, FFstrbuf* version) { + if (exe->chars[0] == '/') + { + ffBinaryExtractStrings(exe->chars, extractGeneralVersion, version, (uint32_t) strlen("0.0.0")); + if (version->length) return true; + } + if(ffProcessAppendStdOut(version, (char* const[]) { exe->chars, "--version",