diff options
| author | JJ Liebig <jonathan.liebig@gmail.com> | 2026-09-17 03:14:57 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-17 03:14:57 +0200 |
| commit | e7e3dfa60e359404def46503dd105c165d02a561 (patch) | |
| tree | 49391ab3b6531066e0a329eaa68ac34b9a9abcc9 /src/client/input/windows_vti.rs | |
| parent | 063e937ee98924893eb487b070bf1e583377084c (diff) | |
fix(windows): recover VT input without changing readers (#4269)
refs #4251
Diffstat (limited to 'src/client/input/windows_vti.rs')
| -rw-r--r-- | src/client/input/windows_vti.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/client/input/windows_vti.rs b/src/client/input/windows_vti.rs index e9cfa4e6..48fe8220 100644 --- a/src/client/input/windows_vti.rs +++ b/src/client/input/windows_vti.rs @@ -86,14 +86,17 @@ fn push_platform_input_events( #[cfg(windows)] pub(super) fn console_input_handle() -> std::io::Result<windows_sys::Win32::Foundation::HANDLE> { use windows_sys::Win32::Foundation::{HANDLE, INVALID_HANDLE_VALUE}; - use windows_sys::Win32::System::Console::{GetStdHandle, STD_INPUT_HANDLE}; + use windows_sys::Win32::System::Console::{GetConsoleMode, GetStdHandle, STD_INPUT_HANDLE}; let handle: HANDLE = unsafe { GetStdHandle(STD_INPUT_HANDLE) }; if handle.is_null() || handle == INVALID_HANDLE_VALUE { - Err(std::io::Error::last_os_error()) - } else { - Ok(handle) + return Err(std::io::Error::last_os_error()); } + let mut mode = 0; + if unsafe { GetConsoleMode(handle, &mut mode) } == 0 { + return Err(std::io::Error::last_os_error()); + } + Ok(handle) } #[cfg(windows)] |
