From e703759258ebed21e3a0aa5e55a163b22fd9d91b Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 1 Jun 2020 16:14:06 +0100 Subject: mod_admin_shell, mod_admin_telnet, util.prosodyctl.shell: Separate output from final result Fixes the client pausing for input after output from commands. --- util/prosodyctl/shell.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'util/prosodyctl/shell.lua') diff --git a/util/prosodyctl/shell.lua b/util/prosodyctl/shell.lua index 0b84eaca..3e70e8f1 100644 --- a/util/prosodyctl/shell.lua +++ b/util/prosodyctl/shell.lua @@ -27,7 +27,7 @@ local function read_line() end local function send_line(client, line) - client.send(st.stanza("repl-line"):text(line)); + client.send(st.stanza("repl-input"):text(line)); end local function repl(client) @@ -103,9 +103,11 @@ local function start(arg) --luacheck: ignore 212/arg end); client.events.add_handler("received", function (stanza) - if stanza.name == "repl-result" then + if stanza.name == "repl-output" or stanza.name == "repl-result" then local result_prefix = stanza.attr.type == "error" and "!" or "|"; print(result_prefix.." "..stanza:get_text()); + end + if stanza.name == "repl-result" then repl(client); end end); -- cgit v1.2.3