Changeset

13051:164c2787901a

util.human.io: Coerce $COLUMNS to number os.getenv() returns a string but term_width() should return a number
author Kim Alvefur <zash@zash.se>
date Fri, 07 Apr 2023 13:54:16 +0200
parents 13050:4ae759490e31
children 13052:585bd71a1a97
files util/human/io.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/util/human/io.lua	Fri Apr 07 13:53:40 2023 +0200
+++ b/util/human/io.lua	Fri Apr 07 13:54:16 2023 +0200
@@ -109,7 +109,7 @@
 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