class

CryTUI::AnsiBackend

Inherits CryTUI::Backend < Reference < Object

ANSI/VT backend for modern terminals. Capability negotiation and raw input are separate concerns; this class owns output state and restoration only.

Constants

MOUSE_OFF = "\e[?1006l\e[?1002l\e[?1000l"
MOUSE_ON = "\e[?1000h\e[?1002h\e[?1006h"

Button-event tracking reports presses, releases, and motion while a button is held, which is what a drag needs; 1006 asks for SGR-encoded coordinates so columns past 223 still report correctly.

Constructors

for_terminal(io : IO, size_source : IO::FileDescriptor, alternate_screen = true, mouse = true) : self
Source
new(io : IO, width : Int, height : Int, alternate_screen : Bool = true, size_source : IO::FileDescriptor | Nil = nil, mouse : Bool = true)
Source

Instance methods

clear
Source
draw(changes : Array(Tuple(Int32, Int32, Cell))) : Nil
Source
enter
Source
leave

Mouse tracking is released before the alternate screen, so a terminal that survives the process still stops reporting. Leaving it on would spray escape sequences into whatever shell prompt comes back.

Source
refresh_size
Source
resize(width : Int, height : Int)
Source
size
Source