From 5562bc6264bdb499aa24e97c0af5d2c1b0fcd00f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 1 Aug 2023 10:23:36 +0800 Subject: [PATCH] Command (Linux): use `/bin/sh` as the default shell --- CHANGELOG.md | 1 + doc/json_schema.json | 2 +- src/data/help.txt | 2 +- src/modules/command/command.c | 8 +++----- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa6b22708..1fe242644 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Changes: * Remove the special handling of Command module (it can be set once in the triditional `config.conf`). Use JSON config with Command module instead * Change `--wm-theme-*` to `--wmtheme-*`. Affect `key` and `format` * Change `--terminal-font-*` to `--terminalfont-*`. Affect `key` and `format` +* Module `Command` uses `/bin/sh` as the default shell on systems other than Windows Features: * FreeBSD support is improved greatly, and actually tested in a phycial machine diff --git a/doc/json_schema.json b/doc/json_schema.json index 8e54130d1..6e92ac2ea 100644 --- a/doc/json_schema.json +++ b/doc/json_schema.json @@ -692,7 +692,7 @@ "const": "command" }, "shell": { - "title": "Set the shell program to execute the command text\nDefault: cmd for Windows, csh for FreeBSD, bash for others", + "title": "Set the shell program to execute the command text\nDefault: cmd for Windows, /bin/sh for *nix", "type": "string" }, "text": { diff --git a/src/data/help.txt b/src/data/help.txt index f2cc97318..2eb23e67f 100644 --- a/src/data/help.txt +++ b/src/data/help.txt @@ -144,7 +144,7 @@ Module specific options: --weather-output-format: The output weather format to be used. It must be URI encoded. --player-name: The name of the player to use --opengl-library : Set the OpenGL context creation library to use. Must be auto, egl, glx or osmesa. Default is auto - --command-shell : Set the shell program to execute the command text. Default is cmd for Windows, csh for FreeBSD, bash for others + --command-shell : Set the shell program to execute the command text. Default is cmd for Windows, /bin/sh for *nix --command-key : Set the module key to display --command-text : Set the command text to be executed --colors-symbol : Set the symbol to be printed by Colors module. Default is block diff --git a/src/modules/command/command.c b/src/modules/command/command.c index 319aed606..7337e7553 100644 --- a/src/modules/command/command.c +++ b/src/modules/command/command.c @@ -39,13 +39,11 @@ void ffInitCommandOptions(FFCommandOptions* options) options->moduleName = FF_COMMAND_MODULE_NAME; ffOptionInitModuleArg(&options->moduleArgs); - ffStrbufInitS(&options->shell, + ffStrbufInitStatic(&options->shell, #ifdef _WIN32 - "cmd" - #elif defined(__FreeBSD__) - "csh" + "cmd.exe" #else - "bash" + "/bin/sh" #endif );