diff --git a/CHANGELOG.md b/CHANGELOG.md index 634aeea2b..39b481c75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ This release introduces a new configuration file format: JSON config Changes: * Drop the dependency of cJSON. We now use [yyjson](https://ibireme.github.io/yyjson/doc/doxygen/html/index.html) to parse JSON documents. +* Remove `--shell-version` and `--terminal-version`. They are always enabled Features: * Support KDE / LXQT / MATE / Cinnamon wallpaper detection (Wallpaper, Linux) diff --git a/completions/bash b/completions/bash index 5752ffdb5..9839ce280 100644 --- a/completions/bash +++ b/completions/bash @@ -193,8 +193,6 @@ __fastfetch_completion() "--pipe" "--title-fqdn" "--escape-bedrock" - "--shell-version" - "--terminal-version" "--disk-folders" "--disk-show-removable" "--disk-show-hidden" diff --git a/src/data/config_user.txt b/src/data/config_user.txt index fcac284d5..6aa72ef17 100644 --- a/src/data/config_user.txt +++ b/src/data/config_user.txt @@ -226,18 +226,6 @@ # Default is false. #--gpu-force-vulkan -# Shell option -# Sets if shell version should be detected and printed -# Must be either true or false -# Default is true. -#--shell-version true - -# Terminal option -# Sets if terminal version should be detected and printed -# Must be either true or false -# Default is true. -#--terminal-version true - # Disk show options # Sets if certain types of disk should be printed # Must be either true or false diff --git a/src/data/help.txt b/src/data/help.txt index 48109de86..e20d535d5 100644 --- a/src/data/help.txt +++ b/src/data/help.txt @@ -104,8 +104,6 @@ Module specific options: --title-fqdn : Set if the title should use fully qualified domain name. Default is false --separator-string : Set the string printed by the separator module --os-file : Set the path to the file containing OS information - --shell-version : Set if shell version should be detected and printed - --terminal-version : Set if terminal version should be detected and printed --disk-folders : A colon (semicolon on Windows) separated list of folder paths for the disk output. Default is "/:/home" ("C:\\;D:\\ ..." on Windows) --disk-show-regular : Set if regular volume should be printed. Default is true --disk-show-removable : Set if removable volume should be printed. Default is true diff --git a/src/detection/terminalshell/terminalshell_linux.c b/src/detection/terminalshell/terminalshell_linux.c index 9bb488e0f..e69e3617d 100644 --- a/src/detection/terminalshell/terminalshell_linux.c +++ b/src/detection/terminalshell/terminalshell_linux.c @@ -353,15 +353,12 @@ const FFTerminalShellResult* ffDetectTerminalShell(const FFinstance* instance) getUserShellFromEnv(instance, &result); ffStrbufClear(&result.shellVersion); - if(instance->config.shell.version) - { - getShellVersion(&result.shellExe, result.shellExeName, &result.shellVersion); + getShellVersion(&result.shellExe, result.shellExeName, &result.shellVersion); - if(strcasecmp(result.shellExeName, result.userShellExeName) != 0) - getShellVersion(&result.userShellExe, result.userShellExeName, &result.userShellVersion); - else - ffStrbufSet(&result.userShellVersion, &result.shellVersion); - } + if(strcasecmp(result.shellExeName, result.userShellExeName) != 0) + getShellVersion(&result.userShellExe, result.userShellExeName, &result.userShellVersion); + else + ffStrbufSet(&result.userShellVersion, &result.shellVersion); if(ffStrbufEqualS(&result.shellProcessName, "pwsh")) ffStrbufInitS(&result.shellPrettyName, "PowerShell"); @@ -389,9 +386,7 @@ const FFTerminalShellResult* ffDetectTerminalShell(const FFinstance* instance) ffStrbufInitCopy(&result.terminalPrettyName, &result.terminalProcessName); ffStrbufInit(&result.terminalVersion); - - if(instance->config.terminal.version) - fftsGetTerminalVersion(&result.terminalProcessName, &result.terminalExe, &result.terminalVersion); + fftsGetTerminalVersion(&result.terminalProcessName, &result.terminalExe, &result.terminalVersion); ffThreadMutexUnlock(&mutex); return &result; diff --git a/src/detection/terminalshell/terminalshell_windows.c b/src/detection/terminalshell/terminalshell_windows.c index a20cfc11a..35a3af0f7 100644 --- a/src/detection/terminalshell/terminalshell_windows.c +++ b/src/detection/terminalshell/terminalshell_windows.c @@ -152,8 +152,7 @@ static uint32_t getShellInfo(const FFinstance* instance, FFTerminalShellResult* } ffStrbufClear(&result->shellVersion); - if(instance->config.shell.version) - fftsGetShellVersion(&result->shellExe, result->shellPrettyName.chars, &result->shellVersion); + fftsGetShellVersion(&result->shellExe, result->shellPrettyName.chars, &result->shellVersion); result->shellPid = pid; if(ffStrbufIgnCaseEqualS(&result->shellPrettyName, "pwsh")) @@ -351,8 +350,7 @@ const FFTerminalShellResult* ffDetectTerminalShell(const FFinstance* instance) getTerminalFromEnv(&result); ffStrbufInit(&result.terminalVersion); - if(instance->config.terminal.version) - fftsGetTerminalVersion(&result.terminalProcessName, &result.terminalExe, &result.terminalVersion); + fftsGetTerminalVersion(&result.terminalProcessName, &result.terminalExe, &result.terminalVersion); exit: ffThreadMutexUnlock(&mutex); diff --git a/src/modules/shell/shell.c b/src/modules/shell/shell.c index d5023c443..c6efb899c 100644 --- a/src/modules/shell/shell.c +++ b/src/modules/shell/shell.c @@ -46,8 +46,6 @@ void ffInitShellOptions(FFShellOptions* options) { options->moduleName = FF_SHELL_MODULE_NAME; ffOptionInitModuleArg(&options->moduleArgs); - - options->version = true; } bool ffParseShellCommandOptions(FFShellOptions* options, const char* key, const char* value) @@ -57,12 +55,6 @@ bool ffParseShellCommandOptions(FFShellOptions* options, const char* key, const if (ffOptionParseModuleArgs(key, subKey, value, &options->moduleArgs)) return true; - if (strcasecmp(subKey, "version") == 0) - { - options->version = ffOptionParseBoolean(value); - return true; - } - return false; } @@ -89,12 +81,6 @@ void ffParseShellJsonObject(FFinstance* instance, yyjson_val* module) if (ffJsonConfigParseModuleArgs(key, val, &options.moduleArgs)) continue; - if (strcasecmp(key, "version") == 0) - { - options.version = yyjson_get_bool(val); - continue; - } - ffPrintError(instance, FF_SHELL_MODULE_NAME, 0, &options.moduleArgs, "Unknown JSON key %s", key); } } diff --git a/src/modules/terminal/option.h b/src/modules/terminal/option.h index 46c9c96fa..151129e13 100644 --- a/src/modules/terminal/option.h +++ b/src/modules/terminal/option.h @@ -8,6 +8,4 @@ typedef struct FFTerminalOptions { const char* moduleName; FFModuleArgs moduleArgs; - - bool version; } FFTerminalOptions; diff --git a/src/modules/terminal/terminal.c b/src/modules/terminal/terminal.c index f90f9bead..4d7db5b46 100644 --- a/src/modules/terminal/terminal.c +++ b/src/modules/terminal/terminal.c @@ -47,8 +47,6 @@ void ffInitTerminalOptions(FFTerminalOptions* options) { options->moduleName = FF_TERMINAL_MODULE_NAME; ffOptionInitModuleArg(&options->moduleArgs); - - options->version = true; } bool ffParseTerminalCommandOptions(FFTerminalOptions* options, const char* key, const char* value) @@ -58,12 +56,6 @@ bool ffParseTerminalCommandOptions(FFTerminalOptions* options, const char* key, if (ffOptionParseModuleArgs(key, subKey, value, &options->moduleArgs)) return true; - if (strcasecmp(subKey, "version") == 0) - { - options->version = ffOptionParseBoolean(value); - return true; - } - return false; } @@ -90,12 +82,6 @@ void ffParseTerminalJsonObject(FFinstance* instance, yyjson_val* module) if (ffJsonConfigParseModuleArgs(key, val, &options.moduleArgs)) continue; - if (strcasecmp(key, "version") == 0) - { - options.version = yyjson_get_bool(val); - continue; - } - ffPrintError(instance, FF_TERMINAL_MODULE_NAME, 0, &options.moduleArgs, "Unknown JSON key %s", key); } }