term: improve sgr mouse button up response

Rather than reporting the basic mouse reporting "button released"
event code, in SGR mouse mode we can report that actual mouse
button that was released.  So do it.

refs: https://github.com/wez/wezterm/issues/211#issuecomment-642877545
This commit is contained in:
Wez Furlong committed 2020-06-11 20:48:10 -07:00
1 parent 87eedfd42d
commit 7c8b69e5a0
1 file changed
+4 -4
+4 -4
View File
@@ -494,11 +494,9 @@ impl TerminalState {
if self.current_mouse_button != MouseButton::None
&& (self.mouse_tracking || self.button_event_mouse || self.any_event_mouse)
{
self.current_mouse_button = MouseButton::None;
let release_button = 3;
if self.sgr_mouse {
let release_button = self.mouse_report_button_number(&event);
self.current_mouse_button = MouseButton::None;
write!(
self.writer,
"\x1b[<{};{};{}m",
@@ -507,6 +505,8 @@ impl TerminalState {
event.y + 1
)?;
} else {
let release_button = 3;
self.current_mouse_button = MouseButton::None;
write!(
self.writer,
"\x1b[M{}{}{}",