Skip to main content

has_vt_input

Function has_vt_input 

Source
pub fn has_vt_input(state: &State) -> bool
Expand description

Return whether state delivers input as VT bytes.

On Windows, this checks ENABLE_VIRTUAL_TERMINAL_INPUT in the saved input console mode. Pass the result to EventSource::set_vt_input after a console mode change. Unix input is always VT bytes, so this returns true on Unix.

use uncurses::event::EventSource;
use uncurses::terminal::{Terminal, has_vt_input};

let mut term = Terminal::stdio();
let mut events = EventSource::new(term.input())?;
term.make_raw()?;
events.set_vt_input(has_vt_input(&term.get_state()?));