Skip to main content

init_terminal

Function init_terminal 

Source
pub fn init_terminal<W: Write>(writer: W) -> Result<TerminalGuard<W>>
Expand description

Initialize terminal for TUI mode: write startup escape sequences (alternate screen, hide cursor, bracketed paste, mouse capture) to the given writer, enable raw mode on stdin, and return a guard that restores the terminal on drop.

The writer parameter allows tests to capture the ANSI sequences without writing to a real terminal.