1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-13 07:22:52 +03:00

slightly refine some mouse processing code

This commit is contained in:
Wez Furlong 2019-03-02 09:40:05 -08:00
parent 150225dd22
commit 61e7f2d0fe

View File

@ -529,7 +529,7 @@ impl TerminalState {
if self.sgr_mouse { if self.sgr_mouse {
write_all( write_all(
writer, writer,
&format!("\x1b[<{};{};{}M", report_button, event.x + 1, event.y + 1).as_bytes(), format!("\x1b[<{};{};{}M", report_button, event.x + 1, event.y + 1).as_bytes(),
)?; )?;
} else if self.screen.is_alt_screen_active() { } else if self.screen.is_alt_screen_active() {
// Send cursor keys instead (equivalent to xterm's alternateScroll mode) // Send cursor keys instead (equivalent to xterm's alternateScroll mode)
@ -559,11 +559,7 @@ impl TerminalState {
)?; )?;
} else if event.button == MouseButton::Middle { } else if event.button == MouseButton::Middle {
let clip = host.get_clipboard()?; let clip = host.get_clipboard()?;
if self.bracketed_paste { self.send_paste(&clip, host.writer())?
write!(host.writer(), "\x1b[200~{}\x1b[201~", clip)?;
} else {
write!(host.writer(), "{}", clip)?;
}
} }
} }