Software /
code /
prosody
Diff
util/human/io.lua @ 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 |
parent | 13049:115ce3ab5b8b |
child | 13054:f4d7fe919969 |
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