package miaou-driver-matrix

  1. Overview
  2. Docs

Module Miaou_driver_matrix.Matrix_ansi_writerSource

ANSI escape sequence writer for the Matrix driver.

Converts diff changes into optimized ANSI escape sequences. Tracks current style state to minimize redundant SGR emissions.

Sourcetype t

Writer state tracking current style.

Sourceval create : unit -> t

Create a new writer with default style.

Sourceval reset : t -> unit

Reset writer to initial state.

Sourceval render : t -> Matrix_diff.change list -> string

Render a list of changes to an ANSI string.

ANSI Control Sequences

Sourceval cursor_hide : string

Hide cursor: ESC?25l

Sourceval cursor_show : string

Show cursor: ESC?25h

Sourceval cursor_home : string

Move cursor to home position (0,0): ESCH

Sourceval cursor_move : row:int -> col:int -> string

Move cursor to position (row, col), 1-indexed for ANSI: ESCrow;colH

Sourceval reset_style : string

Reset all attributes: ESC0m

Sourceval style_to_sgr : Matrix_cell.style -> string

Generate SGR sequence for a style.