diff options
| author | akbash <akbash@herdr.dev> | 2026-09-05 04:39:25 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-05 03:39:25 +0200 |
| commit | 3a822e8106b45745f9d463d9167033f977353d9f (patch) | |
| tree | 5ffbf80074d739c9ac6976e8bfb894b9de16e5f3 /src/pane/input.rs | |
| parent | 7916be1656d8ee9c5882b52753cd47f5e58e3e7e (diff) | |
fix: preserve pixel mouse after sgr reassertion (#3637)
refs #3295
Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>
Diffstat (limited to 'src/pane/input.rs')
| -rw-r--r-- | src/pane/input.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/pane/input.rs b/src/pane/input.rs index 2ff299c9..8de216e8 100644 --- a/src/pane/input.rs +++ b/src/pane/input.rs @@ -66,17 +66,20 @@ pub(super) fn ghostty_mouse_encoder_for_terminal( encoder.set_from_terminal(terminal); let cols = terminal.cols().ok()? as u32; let rows = terminal.rows().ok()? as u32; + let sgr_pixels = terminal + .mode_get(crate::ghostty::MODE_MOUSE_SGR_PIXELS) + .ok()?; match position { crate::input::mouse::Position::Cell { .. } => { - if terminal - .mode_get(crate::ghostty::MODE_MOUSE_SGR_PIXELS) - .ok()? - { + if sgr_pixels { encoder.set_format(crate::ghostty::MOUSE_FORMAT_SGR); } encoder.set_size(cols, rows, 1, 1); } crate::input::mouse::Position::Pixels { .. } => { + if sgr_pixels { + encoder.set_format(crate::ghostty::MOUSE_FORMAT_SGR_PIXELS); + } let width_px = terminal.width_px().ok()?; let height_px = terminal.height_px().ok()?; if width_px == 0 || height_px == 0 || cols == 0 || rows == 0 { |
