package miaou-driver-matrix

  1. Overview
  2. Docs

Module Miaou_driver_matrix.Matrix_main_loopSource

Shared main loop for the Matrix rendering engine.

Contains the event loop, page rendering, modal handling, keymap dispatch, and navigation logic. Parameterized on I/O via Matrix_io.t so it can be reused by different backends (terminal, WebSocket, etc.).

The rendering pipeline (buffer, diff, ANSI writer) is shared across all backends. Only the I/O operations (write, input, size) differ.

Sourcetype context = {
  1. config : Matrix_config.t;
  2. buffer : Matrix_buffer.t;
  3. parser : Matrix_ansi_parser.t;
  4. render_loop : Matrix_render_loop.t;
  5. io : Matrix_io.t;
}

Context required to run the main loop.

Sourceval run : context -> env:Eio_unix.Stdenv.base -> (module Miaou_core.Tui_page.PAGE_SIG) -> [ `Quit | `Back | `SwitchTo of string ]

Run the main loop for a page.

Handles rendering, input, modal dispatch, and navigation. Returns when the page requests a quit or page switch.

Must be called inside Miaou_helpers.Fiber_runtime.with_page_switch.