Diff

util/human/io.lua @ 13045:da0b3cb9a2ec

util.human.io: table: use term_width() to discover terminal width
author Matthew Wild <mwild1@gmail.com>
date Fri, 07 Apr 2023 12:35:39 +0100
parent 13044:5bd272095388
child 13047:d939bf469057
line wrap: on
line diff
--- a/util/human/io.lua	Fri Apr 07 12:33:17 2023 +0100
+++ b/util/human/io.lua	Fri Apr 07 12:35:39 2023 +0100
@@ -126,7 +126,7 @@
 end
 
 local function new_table(col_specs, max_width)
-	max_width = max_width or tonumber(os.getenv("COLUMNS")) or 80;
+	max_width = max_width or term_width(os.getenv("COLUMNS") or 80);
 	local separator = " | ";
 
 	local widths = {};