diff options
author | Aram Drevekenin <aram@poor.dev> | 2022-08-17 09:28:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-17 09:28:51 +0200 |
commit | f4ad946497264dbe8339f50b2e9ef0cf90a2024c (patch) | |
tree | 1a53e6f56d1a8b491457266fadc1d93f118be6b2 /zellij-server/src/panes/terminal_pane.rs | |
parent | b53e3807eb682ba395a7c4f31ace42d67dca5d88 (diff) |
fix(terminal): SGR/UTF8 mouse reporting in terminal panes (#1664)
* work
* work
* fix: selection mishandling
* style(fmt): rustfmt
* style(comments): remove outdated
* style(clippy): make clippy happy
* fix(mouse): off by one sgr/utf8 reporting
* style(fmt): rustfmt
* fix(mouse): correctly report drag event code
* fix(input): support mouse middle click
* style(fmt): rustfmt
Diffstat (limited to 'zellij-server/src/panes/terminal_pane.rs')
-rw-r--r-- | zellij-server/src/panes/terminal_pane.rs | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/zellij-server/src/panes/terminal_pane.rs b/zellij-server/src/panes/terminal_pane.rs index eb884f536..fcb1f63cd 100644 --- a/zellij-server/src/panes/terminal_pane.rs +++ b/zellij-server/src/panes/terminal_pane.rs @@ -566,10 +566,30 @@ impl Pane for TerminalPane { self.borderless } - fn mouse_mode(&self) -> bool { - self.grid.mouse_mode + fn mouse_left_click(&self, position: &Position, is_held: bool) -> Option<String> { + self.grid.mouse_left_click_signal(position, is_held) + } + fn mouse_left_click_release(&self, position: &Position) -> Option<String> { + self.grid.mouse_left_click_release_signal(position) + } + fn mouse_right_click(&self, position: &Position, is_held: bool) -> Option<String> { + self.grid.mouse_right_click_signal(position, is_held) + } + fn mouse_right_click_release(&self, position: &Position) -> Option<String> { + self.grid.mouse_right_click_release_signal(position) + } + fn mouse_middle_click(&self, position: &Position, is_held: bool) -> Option<String> { + self.grid.mouse_middle_click_signal(position, is_held) + } + fn mouse_middle_click_release(&self, position: &Position) -> Option<String> { + self.grid.mouse_middle_click_release_signal(position) + } + fn mouse_scroll_up(&self, position: &Position) -> Option<String> { + self.grid.mouse_scroll_up_signal(position) + } + fn mouse_scroll_down(&self, position: &Position) -> Option<String> { + self.grid.mouse_scroll_down_signal(position) } - fn get_line_number(&self) -> Option<usize> { // + 1 because the absolute position in the scrollback is 0 indexed and this should be 1 indexed Some(self.grid.absolute_position_in_scrollback() + 1) |