MINOR: cli: Use a full prompt command for bidir connections with workers

When a bidirection connection with no command is establisehd with a worker
(so "@@<pid>" alone), a "prompt" command is automatically added to display
the worker's prompt and enter in interactive mode in the worker context.
However, till now, an unfinished command line is sent, with a semicolon
instead of a newline at the end. It is not exactly a bug because this
works. But it is not really expected and could be a problem for future
changes.

So now, a full command line is sent: the "prompt" command finished by a
newline character.
This commit is contained in:
Christopher Faulet 2025-04-24 14:54:55 +02:00
parent d3f9289447
commit 69a9ec5bef

View File

@ -2938,7 +2938,7 @@ int pcli_find_bidir_prefix(struct stream *s, struct channel *req, char **str, co
/* without any command, simply enter the worker in interactive mode */
if (!ret) {
const char *cmd = "prompt;";
const char *cmd = "prompt\n";
ci_insert(req, 0, cmd, strlen(cmd));
ret += strlen(cmd);
}