diff options
Diffstat (limited to 'src/terminal_modes.rs')
| -rw-r--r-- | src/terminal_modes.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/terminal_modes.rs b/src/terminal_modes.rs index 810fa871..11bf56fc 100644 --- a/src/terminal_modes.rs +++ b/src/terminal_modes.rs @@ -26,12 +26,10 @@ pub(crate) fn set_windows_mouse_reporting<W: Write>( } else { WINDOWS_MOUSE_REPORTING_DISABLE_SEQUENCE })?; - if enabled { - writer.write_all(if sgr_pixels { - b"\x1b[?1016h" - } else { - b"\x1b[?1016l" - })?; + // The caller clears modes before native capture. Resetting 1016 here can + // undo the SGR encoding that ConPTY has already enabled on the host. + if enabled && sgr_pixels { + writer.write_all(b"\x1b[?1016h")?; } writer.flush() } @@ -197,7 +195,7 @@ mod tests { assert_eq!( output, - b"\x1b[?1000h\x1b[?1002h\x1b[?1003h\x1b[?1006h\x1b[?1016h\x1b[?1000h\x1b[?1002h\x1b[?1003h\x1b[?1006h\x1b[?1016l\x1b[?1016l\x1b[?1006l\x1b[?1003l\x1b[?1002l\x1b[?1000l" + b"\x1b[?1000h\x1b[?1002h\x1b[?1003h\x1b[?1006h\x1b[?1016h\x1b[?1000h\x1b[?1002h\x1b[?1003h\x1b[?1006h\x1b[?1016l\x1b[?1006l\x1b[?1003l\x1b[?1002l\x1b[?1000l" ); } } |
