aboutsummaryrefslogtreecommitdiffstats
path: root/util/prosodyctl/shell.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-06-01 16:14:06 +0100
committerMatthew Wild <mwild1@gmail.com>2020-06-01 16:14:06 +0100
commitcdeaa5882177f00e6eb3262c7428486874faab28 (patch)
tree7cb207b89ac26e400837e1bdfb471ca43a1853f8 /util/prosodyctl/shell.lua
parentf9176ca0e930cd142df047178f9e585b56275ddf (diff)
downloadprosody-cdeaa5882177f00e6eb3262c7428486874faab28.tar.gz
prosody-cdeaa5882177f00e6eb3262c7428486874faab28.zip
mod_admin_shell, mod_admin_telnet, util.prosodyctl.shell: Separate output from final result
Fixes the client pausing for input after output from commands.
Diffstat (limited to 'util/prosodyctl/shell.lua')
-rw-r--r--util/prosodyctl/shell.lua6
1 files changed, 4 insertions, 2 deletions
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);