MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / init

Function init

crates/opencode-tui/src/app/terminal.rs:6–16  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4pub type Tui = Terminal<CrosstermBackend<Stdout>>;
5
6pub fn init() -> io::Result<Tui> {
7 crossterm::terminal::enable_raw_mode()?;
8 crossterm::execute!(
9 io::stdout(),
10 crossterm::terminal::EnterAlternateScreen,
11 crossterm::event::EnableMouseCapture,
12 crossterm::event::EnableBracketedPaste,
13 )?;
14 let backend = CrosstermBackend::new(io::stdout());
15 Terminal::new(backend)
16}
17
18pub fn restore() -> io::Result<()> {
19 crossterm::execute!(

Callers 3

mainFunction · 0.85
bootstrap_registryFunction · 0.85
newMethod · 0.85

Calls 1

newFunction · 0.85

Tested by

no test coverage detected