pub fn detect() -> TerminalCapsExpand description
Detects terminal graphics capabilities from the process environment.
Examples found in repository?
examples/footers.rs (line 54)
53async fn main() -> io::Result<()> {
54 let caps = detect();
55 let charset = UiContext::default().with_terminal_caps(&caps).charset;
56 let mut terminal = Terminal::enter(TerminalOptions::new(caps).mouse(true))?;
57 let mut renderer = Renderer::new(TtyOut::new()?);
58 renderer.apply_caps(&caps)?;
59 match run(&mut terminal, &mut renderer, charset).await {
60 Ok(()) => terminal.leave_alt(),
61 Err(error) => {
62 let _ = terminal.leave_alt();
63 Err(error)
64 },
65 }
66}