diff options
Diffstat (limited to 'src/bin')
| -rw-r--r-- | src/bin/client/platform.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/client/platform.rs b/src/bin/client/platform.rs index 1a6d71b..817c39d 100644 --- a/src/bin/client/platform.rs +++ b/src/bin/client/platform.rs | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | #[cfg(windows)] | 1 | #[cfg(windows)] |
| 2 | pub mod win { | 2 | pub mod win { |
| 3 | use std::io; | 3 | use std::io; |
| 4 | use std::os::windows::io::AsRawHandle; | ||
| 5 | use winapi::um::consoleapi::GetConsoleMode; | 4 | use winapi::um::consoleapi::GetConsoleMode; |
| 6 | use winapi::um::consoleapi::SetConsoleMode; | 5 | use winapi::um::consoleapi::SetConsoleMode; |
| 7 | use winapi::um::wincon::ENABLE_VIRTUAL_TERMINAL_PROCESSING; | 6 | use winapi::um::wincon::ENABLE_VIRTUAL_TERMINAL_PROCESSING; |
| 7 | use winapi::um::wincon::ENABLE_ECHO_INPUT; | ||
| 8 | use winapi::um::winbase::STD_OUTPUT_HANDLE; | 8 | use winapi::um::winbase::STD_OUTPUT_HANDLE; |
| 9 | use winapi::um::processenv::GetStdHandle; | 9 | use winapi::um::processenv::GetStdHandle; |
| 10 | use winapi::shared::minwindef::DWORD; | 10 | use winapi::shared::minwindef::DWORD; |
| @@ -18,7 +18,7 @@ pub mod win { | |||
| 18 | if GetConsoleMode(h, &mut mode) == 0 { | 18 | if GetConsoleMode(h, &mut mode) == 0 { |
| 19 | return Err(io::Error::last_os_error()); | 19 | return Err(io::Error::last_os_error()); |
| 20 | } | 20 | } |
| 21 | let new = mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING; | 21 | let new = (mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING) & !ENABLE_ECHO_INPUT; |
| 22 | if SetConsoleMode(h, new) == 0 { | 22 | if SetConsoleMode(h, new) == 0 { |
| 23 | return Err(io::Error::last_os_error()); | 23 | return Err(io::Error::last_os_error()); |
| 24 | } | 24 | } |
