diff plugins/mod_admin_shell.lua @ 13938:88f5ea4c28ce

mod_admin_shell: Skip adding margin for tables in non-repl use Since it is there to account for the '| ' prefix added by the shell in interactive mode it is not needed when in non-interactive mode.
author Kim Alvefur <zash@zash.se>
date Sun, 31 Aug 2025 00:41:59 +0200
parents f44f2a8a8c37
children b1e7d3f571b1
line wrap: on
line diff
--- a/plugins/mod_admin_shell.lua	Sat Aug 30 21:55:03 2025 +0200
+++ b/plugins/mod_admin_shell.lua	Sun Aug 31 00:41:59 2025 +0200
@@ -345,12 +345,15 @@
 
 	local default_width = 132; -- The common default of 80 is a bit too narrow for e.g. s2s:show(), 132 was another common width for hardware terminals
 	local margin = 2; -- To account for '| ' when lines are printed
-	session.width = (tonumber(event.stanza.attr.width) or default_width)-margin;
+	session.width = tonumber(event.stanza.attr.width) or default_width;
 
 	local line = event.stanza:get_text();
 	local useglobalenv;
 
 	session.repl = event.stanza.attr.repl ~= "0";
+	if session.repl then
+		session.width = session.width - margin;
+	end
 
 	local result = st.stanza("repl-result");