util.human.io: table: use term_width() to discover terminal width
authorMatthew Wild <mwild1@gmail.com>
Fri, 07 Apr 2023 12:35:39 +0100
changeset 13049 da0b3cb9a2ec
parent 13048 5bd272095388
child 13050 4c3dc767fb11
util.human.io: table: use term_width() to discover terminal width
util/human/io.lua
--- 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 = {};