summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2021-05-08 21:43:25 +0200
committerSébastien Helleu <flashcode@flashtux.org>2021-05-11 21:07:39 +0200
commita9e210121b698ff1b37c5799fb13282478ea050b (patch)
tree9b206206dfc48f266b89578e4075aee4cc85ea58
parent6925ea3ccbd36e413f2d630eb284325be5560712 (diff)
downloadweechat-a9e210121b698ff1b37c5799fb13282478ea050b.zip
fifo: add PID in default FIFO pipe filename (issue #1285)
This is to prevent two WeeChat using the same runtime directory to use the same FIFO pipe.
-rw-r--r--doc/de/weechat_user.de.adoc10
-rw-r--r--doc/en/weechat_user.en.adoc10
-rw-r--r--doc/fr/weechat_user.fr.adoc12
-rw-r--r--doc/it/weechat_user.it.adoc10
-rw-r--r--doc/ja/weechat_user.ja.adoc10
-rw-r--r--doc/pl/weechat_user.pl.adoc10
-rw-r--r--src/plugins/fifo/fifo-command.c7
-rw-r--r--src/plugins/fifo/fifo-config.c2
8 files changed, 36 insertions, 35 deletions
diff --git a/doc/de/weechat_user.de.adoc b/doc/de/weechat_user.de.adoc
index 07b6cf344..13746f055 100644
--- a/doc/de/weechat_user.de.adoc
+++ b/doc/de/weechat_user.de.adoc
@@ -2801,7 +2801,7 @@ ist diese Option aktiviert).
// TRANSLATION MISSING
The FIFO pipe is located in WeeChat runtime directory and is called
-_weechat_fifo_ by default.
+_weechat_fifo_12345_ by default (where _12345_ is the WeeChat process id).
Die Syntax der FIFO Pipe Befehle/Text sieht wie folgt aus:
@@ -2815,26 +2815,26 @@ einige Beispiele:
* Ändert den eigenen Nick auf dem IRC Server freenode in "newnick":
----
-$ echo 'irc.server.freenode */nick newnick' >/run/user/1000/weechat/weechat_fifo
+$ echo 'irc.server.freenode */nick newnick' >/run/user/1000/weechat/weechat_fifo_12345
----
* Schickt eine Nachrich in den IRC #weechat Channel:
----
-$ echo 'irc.freenode.#weechat *hello!' >/run/user/1000/weechat/weechat_fifo
+$ echo 'irc.freenode.#weechat *hello!' >/run/user/1000/weechat/weechat_fifo_12345
----
* Schickt eine Nachricht in den aktuellen Buffer:
----
-$ echo '*hello!' >/run/user/1000/weechat/weechat_fifo
+$ echo '*hello!' >/run/user/1000/weechat/weechat_fifo_12345
----
* Sendet zwei Befehle um alle Python-Skripten zu entfernen und dann neu zu laden (die beiden Befehle müssen
mit "\n" getrennt werden):
----
-$ printf '%b' '*/python unload\n*/python autoload\n' >/run/user/1000/weechat/weechat_fifo
+$ printf '%b' '*/python unload\n*/python autoload\n' >/run/user/1000/weechat/weechat_fifo_12345
----
[[fifo_commands]]
diff --git a/doc/en/weechat_user.en.adoc b/doc/en/weechat_user.en.adoc
index f9310abbe..d14e504d6 100644
--- a/doc/en/weechat_user.en.adoc
+++ b/doc/en/weechat_user.en.adoc
@@ -2741,7 +2741,7 @@ You can remote control WeeChat, by sending commands or text to a FIFO pipe (if
option "fifo.file.enabled" is enabled, it is by default).
The FIFO pipe is located in WeeChat runtime directory and is called
-_weechat_fifo_ by default.
+_weechat_fifo_12345_ by default (where _12345_ is the WeeChat process id).
Syntax for the FIFO pipe commands/text is one of following:
@@ -2755,26 +2755,26 @@ Some examples:
* Change nick on IRC server freenode to "newnick":
----
-$ echo 'irc.server.freenode */nick newnick' >/run/user/1000/weechat/weechat_fifo
+$ echo 'irc.server.freenode */nick newnick' >/run/user/1000/weechat/weechat_fifo_12345
----
* Send a message on IRC #weechat channel:
----
-$ echo 'irc.freenode.#weechat *hello!' >/run/user/1000/weechat/weechat_fifo
+$ echo 'irc.freenode.#weechat *hello!' >/run/user/1000/weechat/weechat_fifo_12345
----
* Send a message on current buffer:
----
-$ echo '*hello!' >/run/user/1000/weechat/weechat_fifo
+$ echo '*hello!' >/run/user/1000/weechat/weechat_fifo_12345
----
* Send two commands to unload/reload Python scripts (you have to separate them
with "\n"):
----
-$ printf '%b' '*/python unload\n*/python autoload\n' >/run/user/1000/weechat/weechat_fifo
+$ printf '%b' '*/python unload\n*/python autoload\n' >/run/user/1000/weechat/weechat_fifo_12345
----
[[fifo_commands]]
diff --git a/doc/fr/weechat_user.fr.adoc b/doc/fr/weechat_user.fr.adoc
index 7c3e9ff38..e44323cbd 100644
--- a/doc/fr/weechat_user.fr.adoc
+++ b/doc/fr/weechat_user.fr.adoc
@@ -2837,8 +2837,8 @@ Vous pouvez contrôler WeeChat à distance, en envoyant des commandes ou du
texte dans un tube FIFO (si l'option _fifo.file.enabled_ est activée,
elle l'est par défaut).
-Le tube FIFO est dans le répertoire WeeChat "runtime" et s'appelle _weechat_fifo_
-par défaut.
+Le tube FIFO est dans le répertoire WeeChat "runtime" et s'appelle
+_weechat_fifo_12345_ par défaut (où _12345_ est le process id de WeeChat).
La syntaxe pour envoyer des commandes ou du texte dans le tube FIFO est une
des suivantes :
@@ -2853,26 +2853,26 @@ Quelques exemples :
* Changer le pseudo sur freenode en "autrepseudo" :
----
-$ echo 'irc.server.freenode */nick autrepseudo' >/run/user/1000/weechat/weechat_fifo
+$ echo 'irc.server.freenode */nick autrepseudo' >/run/user/1000/weechat/weechat_fifo_12345
----
* Envoyer un message sur le canal IRC #weechat :
----
-$ echo 'irc.freenode.#weechat *bonjour !' >/run/user/1000/weechat/weechat_fifo
+$ echo 'irc.freenode.#weechat *bonjour !' >/run/user/1000/weechat/weechat_fifo_12345
----
* Envoyer un message sur le tampon courant :
----
-$ echo '*bonjour !' >/run/user/1000/weechat/weechat_fifo
+$ echo '*bonjour !' >/run/user/1000/weechat/weechat_fifo_12345
----
* Envoyer deux commandes pour décharger/recharger les scripts Python (vous devez
les séparer par "\n") :
----
-$ printf '%b' '*/python unload\n*/python autoload\n' >/run/user/1000/weechat/weechat_fifo
+$ printf '%b' '*/python unload\n*/python autoload\n' >/run/user/1000/weechat/weechat_fifo_12345
----
[[fifo_commands]]
diff --git a/doc/it/weechat_user.it.adoc b/doc/it/weechat_user.it.adoc
index 1488eecae..cf36845b2 100644
--- a/doc/it/weechat_user.it.adoc
+++ b/doc/it/weechat_user.it.adoc
@@ -2946,7 +2946,7 @@ pipe FIFO (se l'opzione "fifo.file.enabled" è abilitata, e lo è per default).
// TRANSLATION MISSING
The FIFO pipe is located in WeeChat runtime directory and is called
-_weechat_fifo_ by default.
+_weechat_fifo_12345_ by default (where _12345_ is the WeeChat process id).
La sintassi per i comandi/testo della pipe FIFO è una delle seguenti:
@@ -2961,28 +2961,28 @@ Alcuni esempi:
* Change nick on IRC server freenode to "newnick":
----
-$ echo 'irc.server.freenode */nick newnick' >/run/user/1000/weechat/weechat_fifo
+$ echo 'irc.server.freenode */nick newnick' >/run/user/1000/weechat/weechat_fifo_12345
----
// TRANSLATION MISSING
* Send a message on IRC #weechat channel:
----
-$ echo 'irc.freenode.#weechat *hello!' >/run/user/1000/weechat/weechat_fifo
+$ echo 'irc.freenode.#weechat *hello!' >/run/user/1000/weechat/weechat_fifo_12345
----
// TRANSLATION MISSING
* Send a message on current buffer:
----
-$ echo '*hello!' >/run/user/1000/weechat/weechat_fifo
+$ echo '*hello!' >/run/user/1000/weechat/weechat_fifo_12345
----
* Inviare due comandi per scaricare/caricare gli script Python (è necessario
separarli con "\n"):
----
-$ printf '%b' '*/python unload\n*/python autoload\n' >/run/user/1000/weechat/weechat_fifo
+$ printf '%b' '*/python unload\n*/python autoload\n' >/run/user/1000/weechat/weechat_fifo_12345
----
[[fifo_commands]]
diff --git a/doc/ja/weechat_user.ja.adoc b/doc/ja/weechat_user.ja.adoc
index af670cc3e..2d39d7e7a 100644
--- a/doc/ja/weechat_user.ja.adoc
+++ b/doc/ja/weechat_user.ja.adoc
@@ -2816,7 +2816,7 @@ include::includes/autogen_user_options.ja.adoc[tag=exec_options]
// TRANSLATION MISSING
The FIFO pipe is located in WeeChat runtime directory and is called
-_weechat_fifo_ by default.
+_weechat_fifo_12345_ by default (where _12345_ is the WeeChat process id).
FIFO パイプに書き込むコマンド/テキストの文法は以下の例の一つです:
@@ -2830,26 +2830,26 @@ FIFO パイプに書き込むコマンド/テキストの文法は以下の例
* IRC サーバ freenode で使うニックネームを "newnick" に変更する:
----
-$ echo 'irc.server.freenode */nick newnick' >/run/user/1000/weechat/weechat_fifo
+$ echo 'irc.server.freenode */nick newnick' >/run/user/1000/weechat/weechat_fifo_12345
----
* IRC チャンネル #weechat に対してテキストを送信:
----
-$ echo 'irc.freenode.#weechat *hello!' >/run/user/1000/weechat/weechat_fifo
+$ echo 'irc.freenode.#weechat *hello!' >/run/user/1000/weechat/weechat_fifo_12345
----
* 現在のバッファに対してテキストを送信:
----
-$ echo '*hello!' >/run/user/1000/weechat/weechat_fifo
+$ echo '*hello!' >/run/user/1000/weechat/weechat_fifo_12345
----
* Python スクリプトのアンロードとロードを行う 2 つのコマンドを送信
(複数のコマンドは "\n" で分割してください):
----
-$ printf '%b' '*/python unload\n*/python autoload\n' >/run/user/1000/weechat/weechat_fifo
+$ printf '%b' '*/python unload\n*/python autoload\n' >/run/user/1000/weechat/weechat_fifo_12345
----
[[fifo_commands]]
diff --git a/doc/pl/weechat_user.pl.adoc b/doc/pl/weechat_user.pl.adoc
index 49ad222e0..a73ce15ab 100644
--- a/doc/pl/weechat_user.pl.adoc
+++ b/doc/pl/weechat_user.pl.adoc
@@ -2775,7 +2775,7 @@ włączona).
// TRANSLATION MISSING
The FIFO pipe is located in WeeChat runtime directory and is called
-_weechat_fifo_ by default.
+_weechat_fifo_12345_ by default (where _12345_ is the WeeChat process id).
Składnia dla komend/tekstu przekazywanego do kolejki FIFO wygląda następująco:
@@ -2789,26 +2789,26 @@ Kilka przykładów:
* Zmiana nicka na serwerze IRC freenode na "newnick":
----
-$ echo 'irc.server.freenode */nick newnick' >/run/user/1000/weechat/weechat_fifo
+$ echo 'irc.server.freenode */nick newnick' >/run/user/1000/weechat/weechat_fifo_12345
----
* Wysłanie wiadomości na kanał IRC #weechat:
----
-$ echo 'irc.freenode.#weechat *hello!' >/run/user/1000/weechat/weechat_fifo
+$ echo 'irc.freenode.#weechat *hello!' >/run/user/1000/weechat/weechat_fifo_12345
----
* Wysłanie wiadomości do obecnego bufora:
----
-$ echo '*hello!' >/run/user/1000/weechat/weechat_fifo
+$ echo '*hello!' >/run/user/1000/weechat/weechat_fifo_12345
----
* Wysłanie dwóch komend do wyładowania/przeładowania skryptów Python (należy
oddzielić je za pomocą "\n"):
----
-$ printf '%b' '*/python unload\n*/python autoload\n' >/run/user/1000/weechat/weechat_fifo
+$ printf '%b' '*/python unload\n*/python autoload\n' >/run/user/1000/weechat/weechat_fifo_12345
----
[[fifo_commands]]
diff --git a/src/plugins/fifo/fifo-command.c b/src/plugins/fifo/fifo-command.c
index 11567d2bf..0d71b7f5d 100644
--- a/src/plugins/fifo/fifo-command.c
+++ b/src/plugins/fifo/fifo-command.c
@@ -102,8 +102,9 @@ fifo_command_init ()
"\n"
"FIFO pipe is used as remote control of WeeChat: you can send "
"commands or text to the FIFO pipe from your shell.\n"
- "By default the FIFO pipe is called weechat_fifo and saved in the "
- "WeeChat runtime directory (see /debug dirs).\n"
+ "By default the FIFO pipe is called weechat_fifo_xxx (where xxx is "
+ "the WeeChat process id) and saved in the WeeChat runtime directory "
+ "(see /debug dirs).\n"
"\n"
"The expected format is one of:\n"
" plugin.buffer *text or command here\n"
@@ -111,7 +112,7 @@ fifo_command_init ()
"\n"
"For example to change your freenode nick:\n"
" echo 'irc.server.freenode */nick newnick' "
- ">/run/user/1000/weechat/weechat_fifo\n"
+ ">/run/user/1000/weechat/weechat_fifo_12345\n"
"\n"
"Please read the user's guide for more info and examples.\n"
"\n"
diff --git a/src/plugins/fifo/fifo-config.c b/src/plugins/fifo/fifo-config.c
index b31d94ff1..7be271197 100644
--- a/src/plugins/fifo/fifo-config.c
+++ b/src/plugins/fifo/fifo-config.c
@@ -122,7 +122,7 @@ fifo_config_init ()
"WeeChat PID can be used in path with ${info:pid} "
"(path is evaluated, see function string_eval_path_home in "
"plugin API reference)"),
- NULL, 0, 0, "${weechat_runtime_dir}/weechat_fifo", NULL, 0,
+ NULL, 0, 0, "${weechat_runtime_dir}/weechat_fifo_${info:pid}", NULL, 0,
NULL, NULL, NULL,
fifo_config_change_file_path, NULL, NULL,
NULL, NULL, NULL);