mod_admin_telnet: Don't pretty-print the normal console stuff
authorKim Alvefur <zash@zash.se>
Sat, 02 May 2020 20:39:33 +0200
changeset 10801 1c61ef6a15ab
parent 10800 89d810a23ee0
child 10802 b81f4fd7f21a
mod_admin_telnet: Don't pretty-print the normal console stuff Typing e.g. `c2s` would dump out a bunch of stuff that would probably just confuse users. Now you only get pretty-printing when poking around in the internals with `>`.
plugins/mod_admin_telnet.lua
--- a/plugins/mod_admin_telnet.lua	Sat May 02 20:37:49 2020 +0200
+++ b/plugins/mod_admin_telnet.lua	Sat May 02 20:39:33 2020 +0200
@@ -145,10 +145,10 @@
 	local taskok, message = chunk();
 
 	if not message then
-		if type(taskok) ~= "string" then
+		if type(taskok) ~= "string" and useglobalenv then
 			taskok = session.serialize(taskok);
 		end
-		session.print("Result: "..taskok);
+		session.print("Result: "..tostring(taskok));
 		return;
 	elseif (not taskok) and message then
 		session.print("Command completed with a problem");
@@ -156,11 +156,7 @@
 		return;
 	end
 
-	if type(message) ~= "string" then
-		message = session.serialize(message);
-	end
-
-	session.print("OK: "..message);
+	session.print("OK: "..tostring(message));
 end
 
 local sessions = {};