Skip to content

Further improve xterm mouse decoding#819

Merged
lhecker merged 1 commit intomainfrom
dev/lhecker/mouse-decoding
Apr 27, 2026
Merged

Further improve xterm mouse decoding#819
lhecker merged 1 commit intomainfrom
dev/lhecker/mouse-decoding

Conversation

@lhecker
Copy link
Copy Markdown
Member

@lhecker lhecker commented Apr 27, 2026

#812 didn't properly fix dragging and mouse
inputs with modifiers. It should be solid now.

@lhecker lhecker added I-bug It shouldn't be doing this. P-high High priority, fix ASAP. Example: The application crashes. labels Apr 27, 2026
@lhecker lhecker requested a review from DHowett April 27, 2026 12:36
Comment thread crates/edit/src/input.rs
Comment on lines +545 to +550
const SHIFT: u16 = 0x04;
const ALT: u16 = 0x08;
const CTRL: u16 = 0x10;
const MOTION: u16 = 0x20;
const WHEEL: u16 = 0x40;
const MODIFIERS: u16 = SHIFT | ALT | CTRL;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code here is almost identical to before with two changes:

  • Properly mask modifiers, etc., off of btn (now called kind)
  • Handle final_byte just in case

Comment thread crates/edit/src/input.rs
m
};
let b = self.parser.x10_mouse_buf[0] as u16 - 0x20;
let x = self.parser.x10_mouse_buf[1] as u16 - 0x20;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i thought xterm mouse reports had a load-bearing offset of 1, and that's what this 0x21 was for?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We now subtract 1 in the unified parse_xterm_mouse function!

@lhecker lhecker merged commit de3db9b into main Apr 27, 2026
8 checks passed
@lhecker lhecker deleted the dev/lhecker/mouse-decoding branch April 27, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

I-bug It shouldn't be doing this. P-high High priority, fix ASAP. Example: The application crashes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants