console.width readonly property
The console.width property gets the current console width in character. That value depends on the current console window size.
Example
local console = require "console"
local colors = { "black", "blue", "green", "cyan", "red", "magenta", "brown", "lightgray", "darkgray", "lightblue", "lightgreen", "lightcyan", "lightred", "lightmagenta", "yellow", "white" }
console.clear()
for color in each(colors) do
console.bgcolor = color
console.write(string.rep(" ", console.width))
console.write(string.rep(" ", console.width))
end
console.readchar()