package matrix

  1. Overview
  2. Docs

Module Input.CapsSource

Terminal capability responses.

Capability events are terminal responses to control sequence queries. They arrive asynchronously and are routed to a separate callback by Parser; they never appear in the user-facing event stream.

Mode reports

Sourcetype mode_report = {
  1. is_private : bool;
  2. modes : (int * int) list;
}

The type for DEC private mode status responses (DECRPM). modes holds (mode, value) pairs following the DEC convention: 0 or 3 for disabled, 1 or 2 for enabled.

Sourceval equal_mode_report : mode_report -> mode_report -> bool

equal_mode_report a b is true iff a and b are structurally equal.

Sourceval pp_mode_report : Format.formatter -> mode_report -> unit

pp_mode_report formats mode reports for debugging.

Capability events

Sourcetype event =
  1. | Device_attributes of int list
    (*

    Device Attributes (DA/DA2/DA3) response payload.

    *)
  2. | Mode_report of mode_report
    (*

    DEC mode status report (DECRPM).

    *)
  3. | Pixel_resolution of int * int
    (*

    Terminal pixel dimensions (width_px, height_px) from CSI 4 ; height ; width t.

    *)
  4. | Cursor_position of int * int
    (*

    Cursor position (row, col), 1-based. Row 1 is the top line, column 1 is the leftmost column.

    *)
  5. | Xtversion of string
    (*

    XTerm XTVERSION response (DCS > | ... ST).

    *)
  6. | Kitty_graphics_reply of string
    (*

    Kitty graphics response (APC G ... ST).

    *)
  7. | Kitty_keyboard of {
    1. level : int;
    2. flags : int option;
    }
    (*

    Kitty keyboard protocol query response CSI ? level [; flags] u. level is non-zero when the protocol is active. flags is the optional terminal-reported bitfield.

    *)
  8. | Color_scheme of [ `Dark | `Light | `Unknown of int ]
    (*

    Color scheme DSR response CSI ? 997 ; value n, the reply to the CSI ? 996 n query. Value 1 is dark, 2 is light.

    *)

The type for terminal capability events.

Sourceval equal_event : event -> event -> bool

equal_event a b is true iff a and b are structurally equal.

Sourceval pp_event : Format.formatter -> event -> unit

pp_event formats capability events for debugging.