lattice_terminal/lib.rs
1//! lattice-terminal: PTY-backed terminal-buffer substrate.
2//!
3//! Issue #40 / Terminal-mode T1 (2026-05-22). See
4//! `docs/dev/architecture/terminal-mode.md` for the design
5//! and `docs/dev/operations/slice-plans/terminal-mode.md` for the
6//! slice breakdown.
7//!
8//! # Surface (T1)
9//!
10//! - [`PtyHandle`]: writer + resize + kill for the master pty
11//! side. Cheap to clone (Arc-backed).
12//! - [`TerminalSnapshot`]: renderer-facing immutable view of
13//! the cell grid + cursor + title. Read via
14//! `ArcSwap::load()` on the hot paint path.
15//! - [`spawn`]: spawns a child process under a fresh PTY,
16//! returns the writer handle + the published snapshot cell.
17//! The reader task is spawned automatically and runs until
18//! the child exits or the handle is dropped.
19//!
20//! Input encoding (`<C-c>` → `\x03` etc.) is wired in T2.
21//! Scrollback navigation + Visual yank land in T3.
22
23pub mod buffer;
24pub mod cell;
25pub mod handle;
26// BC.4: the crate-owned `install(boot)` entry point — one Phase-B line in
27// `editor_boot`.
28pub mod install;
29pub mod modes;
30pub mod reader;
31pub mod snapshot;
32pub mod spawner;
33pub mod synthetic;
34
35pub use buffer::{TerminalBuffer, TerminalVisualState, VisualKind};
36pub use cell::{Cell, CellAttrs, CursorShape, NamedColor, TerminalColor};
37pub use handle::{PtyHandle, PtyHandleError};
38pub use install::install;
39pub use modes::{
40 TerminalInsertMode, TerminalMode, TerminalNormalMode, TerminalNormalModeGuard,
41 register_terminal_modes,
42};
43pub use reader::{GridSearchHit, SearchDir, SharedTerm, TerminalScrollKind};
44pub use snapshot::TerminalSnapshot;
45pub use spawner::{SpawnConfig, SpawnError, spawn};
46pub use synthetic::{SyntheticDoc, TerminalStore, TerminalStoreHandle};