Initialize terminal
()
| 44 | |
| 45 | /// Initialize terminal |
| 46 | pub fn init_terminal() -> Result<Terminal<CrosstermBackend<io::Stdout>>> { |
| 47 | enable_raw_mode()?; |
| 48 | let mut stdout = io::stdout(); |
| 49 | execute!( |
| 50 | stdout, |
| 51 | EnterAlternateScreen, |
| 52 | EnableMouseCapture, |
| 53 | EnableBracketedPaste |
| 54 | )?; |
| 55 | let backend = CrosstermBackend::new(stdout); |
| 56 | let terminal = Terminal::new(backend)?; |
| 57 | Ok(terminal) |
| 58 | } |
| 59 | |
| 60 | /// Restore terminal |
| 61 | pub fn restore_terminal(mut terminal: Terminal<CrosstermBackend<io::Stdout>>) -> Result<()> { |
no outgoing calls
no test coverage detected