Diff

util/prosodyctl/shell.lua @ 10859:8de0057b4279

mod_admin_shell, mod_admin_telnet, util.prosodyctl.shell: Separate output from final result Fixes the client pausing for input after output from commands.
author Matthew Wild <mwild1@gmail.com>
date Mon, 01 Jun 2020 16:14:06 +0100
parent 10858:efa49d484560
child 10867:561138169983
line wrap: on
line diff
--- a/util/prosodyctl/shell.lua	Mon Jun 01 15:44:44 2020 +0100
+++ b/util/prosodyctl/shell.lua	Mon Jun 01 16:14:06 2020 +0100
@@ -27,7 +27,7 @@
 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 @@
 	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);