# HG changeset patch # User Kim Alvefur # Date 1680867539 -7200 # Node ID 4c3dc767fb1144f85dd7335240b788dfb0a8f9b5 # Parent da0b3cb9a2ec9ff44dc3d26bf313997b80f1f1c0 util.prosodyctl.shell: Use new term_width() for width Kicks in if/when readline hasn't set $COLUMNS, e.g. when using the `prosodyctl shell command like this` form. diff -r da0b3cb9a2ec -r 4c3dc767fb11 util/prosodyctl/shell.lua --- a/util/prosodyctl/shell.lua Fri Apr 07 12:35:39 2023 +0100 +++ b/util/prosodyctl/shell.lua Fri Apr 07 13:38:59 2023 +0200 @@ -6,6 +6,7 @@ local unpack = table.unpack or _G.unpack; local tc = require "prosody.util.termcolours"; local isatty = require "prosody.util.pposix".isatty; +local term_width = require"prosody.util.human.io".term_width; local have_readline, readline = pcall(require, "readline"); @@ -29,7 +30,7 @@ end local function send_line(client, line) - client.send(st.stanza("repl-input", { width = os.getenv "COLUMNS" }):text(line)); + client.send(st.stanza("repl-input", { width = os.getenv "COLUMNS" or term_width() }):text(line)); end local function repl(client)