pub struct Terminal { /* private fields */ }crossterm only.Expand description
Concrete crossterm terminal backends, exposed (issue #278) so external
integrations can drive SLT’s render pipeline with their own event loop —
pair with event::from_crossterm. Most apps should use run /
run_inline, which build and drive these internally.
Fullscreen crossterm terminal backend: owns raw mode + the alternate
screen, double-buffers cells, and flushes only the diff each frame.
Exposed (issue #278) so external integrations can drive SLT’s rendering
with their own event loop instead of reimplementing the backend. Pair with
crate::event::from_crossterm to translate input. The built-in
crate::run entry point uses this same type internally.
Implementations§
Source§impl Terminal
impl Terminal
Sourcepub fn new(
mouse: bool,
kitty_keyboard: bool,
report_all_keys: bool,
color_depth: ColorDepth,
) -> Result<Self>
pub fn new( mouse: bool, kitty_keyboard: bool, report_all_keys: bool, color_depth: ColorDepth, ) -> Result<Self>
Construct a fullscreen terminal backend; enters raw mode and the
alternate screen and optionally enables mouse capture and the
kitty keyboard protocol. When report_all_keys is set (and
kitty_keyboard is too), bare modifier presses are reported.
Sourcepub fn buffer_mut(&mut self) -> &mut Buffer
pub fn buffer_mut(&mut self) -> &mut Buffer
Mutable access to the back buffer used by the next render pass.
Sourcepub fn flush(&mut self) -> Result<()>
pub fn flush(&mut self) -> Result<()>
Diff the back buffer against the front buffer, write the changed cells to stdout under a synchronized-output guard, then swap front and back buffers.
Sourcepub fn handle_resize(&mut self) -> Result<()>
pub fn handle_resize(&mut self) -> Result<()>
Re-query the terminal size and resize the front and back buffers to match. Called from the SIGWINCH handler.