# HG changeset patch # User Kim Alvefur # Date 1680868456 -7200 # Node ID 164c2787901a2308ac4e13f186b1ea174bffdd22 # Parent 4ae759490e31ce4e1128b41f2ef1ee8c5dea08a7 util.human.io: Coerce $COLUMNS to number os.getenv() returns a string but term_width() should return a number diff -r 4ae759490e31 -r 164c2787901a util/human/io.lua --- 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