diff options
| author | JJ Liebig <jonathan.liebig@gmail.com> | 2026-09-17 00:07:58 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-17 00:07:58 +0200 |
| commit | 20c15dd7c8e516753a09e74d400b0637f5fd5682 (patch) | |
| tree | ed56565d7851b986071ec453eee757c94478e724 /src/platform | |
| parent | 5f3763dda88e0fefbce14afab7cc2c7232a5e2a8 (diff) | |
fix(windows): preserve VT input during mouse refresh (#4257)
refs #4251
Diffstat (limited to 'src/platform')
| -rw-r--r-- | src/platform/windows.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/platform/windows.rs b/src/platform/windows.rs index 9742b52c..9e39a715 100644 --- a/src/platform/windows.rs +++ b/src/platform/windows.rs @@ -16,6 +16,20 @@ use std::{ mod clipboard_image; mod config_backup; +pub(crate) fn windows_virtual_terminal_input_active() -> bool { + use windows_sys::Win32::Foundation::INVALID_HANDLE_VALUE; + use windows_sys::Win32::System::Console::{ + GetConsoleMode, GetStdHandle, ENABLE_VIRTUAL_TERMINAL_INPUT, STD_INPUT_HANDLE, + }; + + let handle = unsafe { GetStdHandle(STD_INPUT_HANDLE) }; + if handle.is_null() || handle == INVALID_HANDLE_VALUE { + return false; + } + let mut mode = 0; + (unsafe { GetConsoleMode(handle, &mut mode) } != 0) && mode & ENABLE_VIRTUAL_TERMINAL_INPUT != 0 +} + pub(crate) fn classify_child_exit(status: &portable_pty::ExitStatus) -> super::ChildExitReason { // STATUS_CONTROL_C_EXIT is reported without a Unix signal by portable-pty. if status.exit_code() == 0xC000013A { |
