Changeset

10797:1c61ef6a15ab

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 `>`.
author Kim Alvefur <zash@zash.se>
date Sat, 02 May 2020 20:39:33 +0200
parents 10796:89d810a23ee0
children 10798:b81f4fd7f21a
files plugins/mod_admin_telnet.lua
diffstat 1 files changed, 3 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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 = {};