MCPcopy Create free account
hub / github.com/VSCodeConfigHelper/v4 / enable_virtual_terminal

Function enable_virtual_terminal

src-tauri/src/utils/winapi.rs:129–143  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127}
128
129pub fn enable_virtual_terminal() -> bool {
130 unsafe {
131 let handle = Console::GetStdHandle(Console::STD_OUTPUT_HANDLE).unwrap();
132 let mut mode = Console::CONSOLE_MODE(0);
133 if !Console::GetConsoleMode(handle, &mut mode).as_bool() {
134 return false;
135 }
136 if !Console::SetConsoleMode(handle, mode | Console::ENABLE_VIRTUAL_TERMINAL_PROCESSING)
137 .as_bool()
138 {
139 return false;
140 }
141 }
142 return true;
143}
144
145extern "C" {
146 fn _getch() -> i32;

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected