Diff

util/prosodyctl/shell.lua @ 13770:a28349b8a387 13.0

prosodyctl shell: More reliable detection of REPL/interactive mode (fixes #1895)
author Matthew Wild <mwild1@gmail.com>
date Thu, 13 Mar 2025 11:37:11 +0000
parent 13732:1465b1e305df
child 13796:c8e534b4f2e2
line wrap: on
line diff
--- a/util/prosodyctl/shell.lua	Thu Mar 13 11:35:39 2025 +0000
+++ b/util/prosodyctl/shell.lua	Thu Mar 13 11:37:11 2025 +0000
@@ -29,8 +29,8 @@
 	end
 end
 
-local function send_line(client, line)
-	client.send(st.stanza("repl-input", { width = tostring(term_width()) }):text(line));
+local function send_line(client, line, interactive)
+	client.send(st.stanza("repl-input", { width = tostring(term_width()), repl = interactive == false and "0" or "1" }):text(line));
 end
 
 local function repl(client)
@@ -91,7 +91,7 @@
 		end
 
 		client.events.add_handler("connected", function()
-			send_line(client, arg[1]);
+			send_line(client, arg[1], false);
 			return true;
 		end, 1);