diff options
author | Kim Alvefur <zash@zash.se> | 2023-04-07 13:54:16 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2023-04-07 13:54:16 +0200 |
commit | d458a42c61b165bb4750d0124cf4db4eb35c9fab (patch) | |
tree | 086956c6169f3b6d55fbf53d12e7c914ecb985d3 /util | |
parent | 4725a9621801371f90302690c4e6e228e324982d (diff) | |
download | prosody-d458a42c61b165bb4750d0124cf4db4eb35c9fab.tar.gz prosody-d458a42c61b165bb4750d0124cf4db4eb35c9fab.zip |
util.human.io: Coerce $COLUMNS to number
os.getenv() returns a string but term_width() should return a number
Diffstat (limited to 'util')
-rw-r--r-- | util/human/io.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/util/human/io.lua b/util/human/io.lua index 5c826176..8a903d38 100644 --- a/util/human/io.lua +++ b/util/human/io.lua @@ -109,7 +109,7 @@ if utf8.len and utf8.offset then end local function term_width(default) - local env_cols = os.getenv "COLUMNS"; + local env_cols = tonumber(os.getenv "COLUMNS"); if env_cols then return env_cols; end local stty = io.popen("stty -a"); if not stty then return default; end |