diff options
-rw-r--r-- | ChangeLog.adoc | 1 | ||||
-rw-r--r-- | doc/de/autogen/user/exec_options.adoc | 6 | ||||
-rw-r--r-- | doc/en/autogen/user/exec_options.adoc | 6 | ||||
-rw-r--r-- | doc/fr/autogen/user/exec_options.adoc | 6 | ||||
-rw-r--r-- | doc/it/autogen/user/exec_options.adoc | 6 | ||||
-rw-r--r-- | doc/ja/autogen/user/exec_options.adoc | 6 | ||||
-rw-r--r-- | doc/pl/autogen/user/exec_options.adoc | 6 | ||||
-rw-r--r-- | po/cs.po | 8 | ||||
-rw-r--r-- | po/de.po | 8 | ||||
-rw-r--r-- | po/es.po | 8 | ||||
-rw-r--r-- | po/fr.po | 13 | ||||
-rw-r--r-- | po/hu.po | 8 | ||||
-rw-r--r-- | po/it.po | 8 | ||||
-rw-r--r-- | po/ja.po | 8 | ||||
-rw-r--r-- | po/pl.po | 8 | ||||
-rw-r--r-- | po/pt.po | 8 | ||||
-rw-r--r-- | po/pt_BR.po | 8 | ||||
-rw-r--r-- | po/ru.po | 8 | ||||
-rw-r--r-- | po/tr.po | 8 | ||||
-rw-r--r-- | po/weechat.pot | 8 | ||||
-rw-r--r-- | src/plugins/exec/exec-command.c | 23 | ||||
-rw-r--r-- | src/plugins/exec/exec-config.c | 11 | ||||
-rw-r--r-- | src/plugins/exec/exec-config.h | 1 |
23 files changed, 163 insertions, 18 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 2fa18c96b..bf1233847 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -24,6 +24,7 @@ New features:: * api: add functions string_base_encode and string_base_decode, remove functions string_encode_base64 and string_decode_base64 * api: add support of Time-based One-Time Password (TOTP), add infos "totp_generate" and "totp_validate" * buflist: add variable ${number2}, always set with the indented buffer number + * exec: add option exec.command.shell to customize the shell used with /exec -sh * relay: add support of close frame in websocket connection (issue #1281) * relay: add support of Time-based One-Time Password (TOTP) as second authentication factor in weechat protocol diff --git a/doc/de/autogen/user/exec_options.adoc b/doc/de/autogen/user/exec_options.adoc index 9cd96c348..c79d6e784 100644 --- a/doc/de/autogen/user/exec_options.adoc +++ b/doc/de/autogen/user/exec_options.adoc @@ -25,3 +25,9 @@ ** Typ: integer ** Werte: -1 .. 25920000 ** Standardwert: `+0+` + +* [[option_exec.command.shell]] *exec.command.shell* +** Beschreibung: pass:none[shell to use with command "/exec -sh"; it can be just the name of shell if it is in PATH (for example "bash") or the absolute path to the shell (for example "/bin/bash")] +** Typ: Zeichenkette +** Werte: beliebige Zeichenkette +** Standardwert: `+"sh"+` diff --git a/doc/en/autogen/user/exec_options.adoc b/doc/en/autogen/user/exec_options.adoc index 5d8555678..4ca387283 100644 --- a/doc/en/autogen/user/exec_options.adoc +++ b/doc/en/autogen/user/exec_options.adoc @@ -25,3 +25,9 @@ ** type: integer ** values: -1 .. 25920000 ** default value: `+0+` + +* [[option_exec.command.shell]] *exec.command.shell* +** description: pass:none[shell to use with command "/exec -sh"; it can be just the name of shell if it is in PATH (for example "bash") or the absolute path to the shell (for example "/bin/bash")] +** type: string +** values: any string +** default value: `+"sh"+` diff --git a/doc/fr/autogen/user/exec_options.adoc b/doc/fr/autogen/user/exec_options.adoc index d3cac1f23..185c7b073 100644 --- a/doc/fr/autogen/user/exec_options.adoc +++ b/doc/fr/autogen/user/exec_options.adoc @@ -25,3 +25,9 @@ ** type: entier ** valeurs: -1 .. 25920000 ** valeur par défaut: `+0+` + +* [[option_exec.command.shell]] *exec.command.shell* +** description: pass:none[shell à utiliser avec la commande "/exec -sh" ; cela peut être seulement le nom du shell s'il est dans le PATH (par exemple "bash") ou le chemin absolu vers le shell (par exemple "/bin/bash")] +** type: chaîne +** valeurs: toute chaîne +** valeur par défaut: `+"sh"+` diff --git a/doc/it/autogen/user/exec_options.adoc b/doc/it/autogen/user/exec_options.adoc index 7f8519ca9..e65192aae 100644 --- a/doc/it/autogen/user/exec_options.adoc +++ b/doc/it/autogen/user/exec_options.adoc @@ -25,3 +25,9 @@ ** tipo: intero ** valori: -1 .. 25920000 ** valore predefinito: `+0+` + +* [[option_exec.command.shell]] *exec.command.shell* +** descrizione: pass:none[shell to use with command "/exec -sh"; it can be just the name of shell if it is in PATH (for example "bash") or the absolute path to the shell (for example "/bin/bash")] +** tipo: stringa +** valori: qualsiasi stringa +** valore predefinito: `+"sh"+` diff --git a/doc/ja/autogen/user/exec_options.adoc b/doc/ja/autogen/user/exec_options.adoc index 28d1b16b9..077251563 100644 --- a/doc/ja/autogen/user/exec_options.adoc +++ b/doc/ja/autogen/user/exec_options.adoc @@ -25,3 +25,9 @@ ** タイプ: 整数 ** 値: -1 .. 25920000 ** デフォルト値: `+0+` + +* [[option_exec.command.shell]] *exec.command.shell* +** 説明: pass:none[shell to use with command "/exec -sh"; it can be just the name of shell if it is in PATH (for example "bash") or the absolute path to the shell (for example "/bin/bash")] +** タイプ: 文字列 +** 値: 未制約文字列 +** デフォルト値: `+"sh"+` diff --git a/doc/pl/autogen/user/exec_options.adoc b/doc/pl/autogen/user/exec_options.adoc index 69bc4bf1f..3248ca098 100644 --- a/doc/pl/autogen/user/exec_options.adoc +++ b/doc/pl/autogen/user/exec_options.adoc @@ -25,3 +25,9 @@ ** typ: liczba ** wartości: -1 .. 25920000 ** domyślna wartość: `+0+` + +* [[option_exec.command.shell]] *exec.command.shell* +** opis: pass:none[shell to use with command "/exec -sh"; it can be just the name of shell if it is in PATH (for example "bash") or the absolute path to the shell (for example "/bin/bash")] +** typ: ciąg +** wartości: dowolny ciąg +** domyślna wartość: `+"sh"+` @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2018-11-17 08:09+0100\n" +"POT-Creation-Date: 2018-11-17 11:35+0100\n" "PO-Revision-Date: 2018-11-17 10:36+0100\n" "Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -5472,6 +5472,12 @@ msgid "" "immediately, -1 = never purge)" msgstr "" +msgid "" +"shell to use with command \"/exec -sh\"; it can be just the name of shell if " +"it is in PATH (for example \"bash\") or the absolute path to the shell (for " +"example \"/bin/bash\")" +msgstr "" + #, fuzzy msgid "text color for a running command flag in list of commands" msgstr "barva textu pro akce ve vstupní řádce" @@ -24,7 +24,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2018-11-17 08:09+0100\n" +"POT-Creation-Date: 2018-11-17 11:35+0100\n" "PO-Revision-Date: 2018-11-17 11:04+0100\n" "Last-Translator: Nils Görs <weechatter@arcor.de>\n" "Language-Team: German <kde-i18n-de@kde.org>\n" @@ -6676,6 +6676,12 @@ msgstr "" "Wartezeit bis nicht mehr ausgeführte Befehle gelöscht werden (in Sekunden, 0 " "= lösche Befehle unmittelbar, -1 = niemals löschen)" +msgid "" +"shell to use with command \"/exec -sh\"; it can be just the name of shell if " +"it is in PATH (for example \"bash\") or the absolute path to the shell (for " +"example \"/bin/bash\")" +msgstr "" + msgid "text color for a running command flag in list of commands" msgstr "" "Textfarbe des Statusindikator (in der Auflistung der Befehle) für Befehle " @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2018-11-17 08:09+0100\n" +"POT-Creation-Date: 2018-11-17 11:35+0100\n" "PO-Revision-Date: 2018-11-17 10:36+0100\n" "Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -5687,6 +5687,12 @@ msgid "" "immediately, -1 = never purge)" msgstr "" +msgid "" +"shell to use with command \"/exec -sh\"; it can be just the name of shell if " +"it is in PATH (for example \"bash\") or the absolute path to the shell (for " +"example \"/bin/bash\")" +msgstr "" + #, fuzzy msgid "text color for a running command flag in list of commands" msgstr "color para acciones en la línea de entrada" @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2018-11-17 08:09+0100\n" -"PO-Revision-Date: 2018-11-17 10:35+0100\n" +"POT-Creation-Date: 2018-11-17 11:35+0100\n" +"PO-Revision-Date: 2018-11-17 11:37+0100\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: fr\n" @@ -6513,6 +6513,15 @@ msgstr "" "délai pour purger les commandes terminées (en secondes, 0 = purger les " "commandes immédiatement, -1 = ne jamais purger)" +msgid "" +"shell to use with command \"/exec -sh\"; it can be just the name of shell if " +"it is in PATH (for example \"bash\") or the absolute path to the shell (for " +"example \"/bin/bash\")" +msgstr "" +"shell à utiliser avec la commande \"/exec -sh\" ; cela peut être seulement " +"le nom du shell s'il est dans le PATH (par exemple \"bash\") ou le chemin " +"absolu vers le shell (par exemple \"/bin/bash\")" + msgid "text color for a running command flag in list of commands" msgstr "" "couleur du texte pour le drapeau d'une commande qui tourne dans la liste des " @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2018-11-17 08:09+0100\n" +"POT-Creation-Date: 2018-11-17 11:35+0100\n" "PO-Revision-Date: 2018-11-17 10:36+0100\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -5001,6 +5001,12 @@ msgid "" "immediately, -1 = never purge)" msgstr "" +msgid "" +"shell to use with command \"/exec -sh\"; it can be just the name of shell if " +"it is in PATH (for example \"bash\") or the absolute path to the shell (for " +"example \"/bin/bash\")" +msgstr "" + #, fuzzy msgid "text color for a running command flag in list of commands" msgstr "kilépési nyíl színe" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2018-11-17 08:09+0100\n" +"POT-Creation-Date: 2018-11-17 11:35+0100\n" "PO-Revision-Date: 2018-11-17 10:36+0100\n" "Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -5856,6 +5856,12 @@ msgid "" "immediately, -1 = never purge)" msgstr "" +msgid "" +"shell to use with command \"/exec -sh\"; it can be just the name of shell if " +"it is in PATH (for example \"bash\") or the absolute path to the shell (for " +"example \"/bin/bash\")" +msgstr "" + #, fuzzy msgid "text color for a running command flag in list of commands" msgstr "colore del testo per le azioni sulla riga di input" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2018-11-17 08:09+0100\n" +"POT-Creation-Date: 2018-11-17 11:35+0100\n" "PO-Revision-Date: 2018-11-17 10:36+0100\n" "Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n" "Language-Team: Japanese <https://github.com/l/weechat/tree/master/" @@ -6228,6 +6228,12 @@ msgstr "" "接続を切ったクライアントを追い出すまでの遅延時間 (秒単位、0 = すぐにクライア" "ントを追い出す、-1 = 追い出さない)" +msgid "" +"shell to use with command \"/exec -sh\"; it can be just the name of shell if " +"it is in PATH (for example \"bash\") or the absolute path to the shell (for " +"example \"/bin/bash\")" +msgstr "" + msgid "text color for a running command flag in list of commands" msgstr "コマンドリストで使う実行中コマンドのフラグに対するテキスト色" @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2018-11-17 08:09+0100\n" +"POT-Creation-Date: 2018-11-17 11:35+0100\n" "PO-Revision-Date: 2018-11-17 10:36+0100\n" "Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n" "Language-Team: Polish <kde-i18n-doc@kde.org>\n" @@ -6357,6 +6357,12 @@ msgstr "" "opóźnienie dla kasowania zakończonych komend (w sekundach, 0 = natychmiast, " "-1 = nigdy)" +msgid "" +"shell to use with command \"/exec -sh\"; it can be just the name of shell if " +"it is in PATH (for example \"bash\") or the absolute path to the shell (for " +"example \"/bin/bash\")" +msgstr "" + msgid "text color for a running command flag in list of commands" msgstr "kolor dla flagi wykonywanej komendy na liście komend" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2018-11-17 08:09+0100\n" +"POT-Creation-Date: 2018-11-17 11:35+0100\n" "PO-Revision-Date: 2018-11-17 10:36+0100\n" "Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n" "Language-Team: Portuguese <>\n" @@ -6209,6 +6209,12 @@ msgstr "" "atraso para purgar comandos concluídos (em segundos, 0 = eliminar comandos " "imediatamente, -1 = nunca eliminar)" +msgid "" +"shell to use with command \"/exec -sh\"; it can be just the name of shell if " +"it is in PATH (for example \"bash\") or the absolute path to the shell (for " +"example \"/bin/bash\")" +msgstr "" + msgid "text color for a running command flag in list of commands" msgstr "cor do texto do sinalizador de comando a executar na lista de comandos" diff --git a/po/pt_BR.po b/po/pt_BR.po index 465e57517..87d84b39f 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2018-11-17 08:09+0100\n" +"POT-Creation-Date: 2018-11-17 11:35+0100\n" "PO-Revision-Date: 2018-11-17 10:36+0100\n" "Last-Translator: Eduardo Elias <camponez@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -5650,6 +5650,12 @@ msgid "" "immediately, -1 = never purge)" msgstr "" +msgid "" +"shell to use with command \"/exec -sh\"; it can be just the name of shell if " +"it is in PATH (for example \"bash\") or the absolute path to the shell (for " +"example \"/bin/bash\")" +msgstr "" + #, fuzzy msgid "text color for a running command flag in list of commands" msgstr "cor de texto para ações de linha de entrada" @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2018-11-17 08:09+0100\n" +"POT-Creation-Date: 2018-11-17 11:35+0100\n" "PO-Revision-Date: 2018-11-17 10:36+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -5039,6 +5039,12 @@ msgid "" "immediately, -1 = never purge)" msgstr "" +msgid "" +"shell to use with command \"/exec -sh\"; it can be just the name of shell if " +"it is in PATH (for example \"bash\") or the absolute path to the shell (for " +"example \"/bin/bash\")" +msgstr "" + #, fuzzy msgid "text color for a running command flag in list of commands" msgstr "цвет действий в поле ввода" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2018-11-17 08:09+0100\n" +"POT-Creation-Date: 2018-11-17 11:35+0100\n" "PO-Revision-Date: 2018-11-17 10:36+0100\n" "Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -4592,6 +4592,12 @@ msgid "" "immediately, -1 = never purge)" msgstr "" +msgid "" +"shell to use with command \"/exec -sh\"; it can be just the name of shell if " +"it is in PATH (for example \"bash\") or the absolute path to the shell (for " +"example \"/bin/bash\")" +msgstr "" + #, fuzzy msgid "text color for a running command flag in list of commands" msgstr "kanal isimleri için metin rengi" diff --git a/po/weechat.pot b/po/weechat.pot index be4242aa9..e14689291 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2018-11-17 08:09+0100\n" +"POT-Creation-Date: 2018-11-17 11:35+0100\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -4573,6 +4573,12 @@ msgid "" "immediately, -1 = never purge)" msgstr "" +msgid "" +"shell to use with command \"/exec -sh\"; it can be just the name of shell if " +"it is in PATH (for example \"bash\") or the absolute path to the shell (for " +"example \"/bin/bash\")" +msgstr "" + msgid "text color for a running command flag in list of commands" msgstr "" diff --git a/src/plugins/exec/exec-command.c b/src/plugins/exec/exec-command.c index b5e4dfc52..32a00c410 100644 --- a/src/plugins/exec/exec-command.c +++ b/src/plugins/exec/exec-command.c @@ -405,7 +405,8 @@ int exec_command_run (struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol, int start_arg) { - char str_buffer[512]; + char str_buffer[512], *default_shell = "sh"; + const char *ptr_shell; struct t_exec_cmd *new_exec_cmd; struct t_exec_cmd_options cmd_options; struct t_hashtable *process_options; @@ -480,6 +481,19 @@ exec_command_run (struct t_gui_buffer *buffer, /* automatically disable shell if we are downloading an URL */ if (strncmp (argv_eol[cmd_options.command_index], "url:", 4) == 0) cmd_options.use_shell = 0; + + /* get default shell */ + if (cmd_options.use_shell) + { + ptr_shell = weechat_config_string (exec_config_command_shell); + if (!ptr_shell || !ptr_shell[0]) + ptr_shell = default_shell; + } + else + { + ptr_shell = NULL; + } + if (cmd_options.use_shell) { /* command will be: sh -c "command arguments..." */ @@ -574,14 +588,15 @@ exec_command_run (struct t_gui_buffer *buffer, /* execute the command */ if (weechat_exec_plugin->debug >= 1) { - weechat_printf (NULL, "%s: executing command: \"%s%s%s\"", + weechat_printf (NULL, "%s: executing command: \"%s%s%s%s\"", EXEC_PLUGIN_NAME, - (cmd_options.use_shell) ? "sh -c '" : "", + (cmd_options.use_shell) ? ptr_shell : "", + (cmd_options.use_shell) ? " -c '" : "", argv_eol[cmd_options.command_index], (cmd_options.use_shell) ? "'" : ""); } new_exec_cmd->hook = weechat_hook_process_hashtable ( - (cmd_options.use_shell) ? "sh" : argv_eol[cmd_options.command_index], + (cmd_options.use_shell) ? ptr_shell : argv_eol[cmd_options.command_index], process_options, cmd_options.timeout * 1000, &exec_process_cb, diff --git a/src/plugins/exec/exec-config.c b/src/plugins/exec/exec-config.c index 43693aa47..017cff635 100644 --- a/src/plugins/exec/exec-config.c +++ b/src/plugins/exec/exec-config.c @@ -34,6 +34,7 @@ struct t_config_file *exec_config_file = NULL; struct t_config_option *exec_config_command_default_options; struct t_config_option *exec_config_command_purge_delay; +struct t_config_option *exec_config_command_shell; /* exec config, color section */ @@ -130,6 +131,16 @@ exec_config_init () "commands immediately, -1 = never purge)"), NULL, -1, 36000 * 24 * 30, "0", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + exec_config_command_shell = weechat_config_new_option ( + exec_config_file, ptr_section, + "shell", "string", + N_("shell to use with command \"/exec -sh\"; it can be just the name " + "of shell if it is in PATH (for example \"bash\") or the absolute " + "path to the shell (for example \"/bin/bash\")"), + NULL, 0, 0, "sh", NULL, 0, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL); /* color */ ptr_section = weechat_config_new_section (exec_config_file, "color", diff --git a/src/plugins/exec/exec-config.h b/src/plugins/exec/exec-config.h index 537597c11..ded5fde01 100644 --- a/src/plugins/exec/exec-config.h +++ b/src/plugins/exec/exec-config.h @@ -26,6 +26,7 @@ extern struct t_config_file *exec_config_file; extern struct t_config_option *exec_config_command_default_options; extern struct t_config_option *exec_config_command_purge_delay; +extern struct t_config_option *exec_config_command_shell; extern struct t_config_option *exec_config_color_flag_running; extern struct t_config_option *exec_config_color_flag_finished; |