Skip to main content

Crate tear_core

Crate tear_core 

Source
Expand description

tear-core — runtime logic for the tear multiplexer.

Houses the session/window/pane state machine, PTY ownership (portable-pty), the layout engine, and the InProcess implementation of tear_types::MultiplexerControl.

§Why this matters for the mado integration

mado currently owns its own pane.rs/tab.rs with private state machines. At M5 those modules rebase onto tear-core::InProcess — both apps then share one source of truth for pane semantics. This crate’s InProcess impl is the gravitational center the eventual rebase lands on.

No daemon — those live in tear-daemon. Daemon-side composition wraps InProcess rather than reimplementing.

Re-exports§

pub use blocks::BlockExtractor;
pub use inproc::InProcess;
pub use reap::AllPanesExited;
pub use pane_grid::PaneGrid;
pub use recording::PaneEvent;
pub use recording::PaneRecording;

Modules§

blocks
Pane-as-block — OSC 133 prompt-mark-driven block extractor.
inproc
InProcess — the in-memory tear_types::MultiplexerControl implementation backed by parking_lot::RwLock<Registry> + BTreeMap<PaneId, PtyHandle>.
pane_grid
Per-pane terminal cell grid driven by a vte parser.
pty
PTY ownership — one PtyHandle per running pane.
reap
The typed admission ticket for daemon-initiated session removal.
recording
Per-pane recording — captures every PTY byte with a relative timestamp, exposes a ring-buffered snapshot, and exports as asciinema v2 .cast (JSON-lines) so any external player handles playback. Daemon-native: no asciinema rec wrapper needed.
registry
In-memory session/window/pane registry — the typed state machine every crate::InProcess op composes against.

Structs§

Block
Re-export the wire shape so callers don’t have to choose between tear-core and tear-types — they’re the same type.
Cell
One cell in a snapshotted pane. Carries the rendered character
PaneSnapshot
Serializable snapshot of one pane’s visible grid + cursor. Sent over the tear-daemon ↔ tear-client wire so consumers can render without holding a reference into the live parser state.