From d458a42c61b165bb4750d0124cf4db4eb35c9fab Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 7 Apr 2023 13:54:16 +0200 Subject: util.human.io: Coerce $COLUMNS to number os.getenv() returns a string but term_width() should return a number --- util/human/io.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util') 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 -- cgit v1.2.3