Code: Select all
Structure winsize
ws_row.w ; rows
ws_col.w ; columns
EndStructure
#STDIN_FILENO = 0 ; file descriptor of standard input
#TIOCGWINSZ = $5413 ; IOCTL request to get terminal window sizes
OpenConsole()
ws.winsize
If ioctl_(#STDIN_FILENO, #TIOCGWINSZ, @ws) = 0
PrintN("Text console sizes:")
PrintN("Rows: " + Str(ws\ws_row))
PrintN("Columns: " + Str(ws\ws_col))
Else
PrintN("Error getting console sizes.")
EndIf
Input()