windcon is a Lua module for interacting with the console on Windows.
local windcon = require('windcon')
-- Clear the screen
windcon.clear()
-- Get the console size
local w, h = windcon.size()
-- Move the cursor to the center
windcon.movecursor(w / 2, h / 2)
-- Hide the cursor
windcon.showcursor(false)With Luarocks:
luarocks install windcon
Sets the visibility of the cursor to state. On success, returns true.
Moves the cursor to the given coordinates. On success, returns true; otherwise, returns nil, errmsg.
Clears the screen. On success, returns true; otherwise, returns nil, errmsg.
Returns the width and height of the console.