plugins/mod_admin_telnet.lua
changeset 10799 4c90f06f2247
parent 10796 ef2bd183f660
child 10800 89d810a23ee0
--- a/plugins/mod_admin_telnet.lua	Sat May 02 20:12:41 2020 +0200
+++ b/plugins/mod_admin_telnet.lua	Sat May 02 20:32:43 2020 +0200
@@ -330,9 +330,18 @@
 -- Anything in def_env will be accessible within the session as a global variable
 
 --luacheck: ignore 212/self
+local serialize_defaults = module:get_option("console_prettyprint_settings", { fatal = false, unquoted = true, maxdepth = 2})
 
 def_env.output = {};
 function def_env.output:configure(opts)
+	if type(opts) ~= "table" then
+		opts = { preset = opts };
+	end
+	for k,v in pairs(serialize_defaults) do
+		if opts[k] == nil then
+			opts[k] = v;
+		end
+	end
 	self.session.serialize = serialization.new(opts);
 end