diff --git a/wezterm-gui/src/termwindow/mod.rs b/wezterm-gui/src/termwindow/mod.rs index df89efbf8..3b5374902 100644 --- a/wezterm-gui/src/termwindow/mod.rs +++ b/wezterm-gui/src/termwindow/mod.rs @@ -1730,10 +1730,10 @@ impl TermWindow { } } - fn update_text_cursor(&mut self, pane: &Rc) { - let cursor = pane.get_cursor_position(); + fn update_text_cursor(&mut self, pos: &PositionedPane) { if let Some(win) = self.window.as_ref() { - let top = pane.get_dimensions().physical_top; + let cursor = pos.pane.get_cursor_position(); + let top = pos.pane.get_dimensions().physical_top; let tab_bar_height = if self.show_tab_bar && !self.config.tab_bar_at_bottom { self.tab_bar_pixel_height().unwrap() } else { @@ -1743,9 +1743,10 @@ impl TermWindow { let r = Rect::new( Point::new( - (cursor.x.max(0) as isize * self.render_metrics.cell_size.width) + (((cursor.x + pos.left) as isize).max(0) * self.render_metrics.cell_size.width) .add(padding_left as isize), - ((cursor.y - top).max(0) as isize * self.render_metrics.cell_size.height) + ((cursor.y + pos.top as isize - top).max(0) + * self.render_metrics.cell_size.height) .add(tab_bar_height as isize) .add(padding_top as isize), ), diff --git a/wezterm-gui/src/termwindow/render.rs b/wezterm-gui/src/termwindow/render.rs index d2184b551..1c8b3af97 100644 --- a/wezterm-gui/src/termwindow/render.rs +++ b/wezterm-gui/src/termwindow/render.rs @@ -1625,7 +1625,7 @@ impl super::TermWindow { for pos in panes { if pos.is_active { - self.update_text_cursor(&pos.pane); + self.update_text_cursor(&pos); if focused { pos.pane.advise_focus(); mux::Mux::get()