diff --git a/config/src/config.rs b/config/src/config.rs index 1fa17619f..6c1ac15b7 100644 --- a/config/src/config.rs +++ b/config/src/config.rs @@ -627,6 +627,12 @@ pub struct Config { #[dynamic(default = "default_true")] pub hide_mouse_cursor_when_typing: bool, + /// If true, the mouse cursor will be an arrow if + /// the application has captured the mouse. + /// This option is true by default. + #[dynamic(default = "default_true")] + pub use_arrow_mouse_cursor_when_mouse_reporting: bool, + /// If non-zero, specifies the period (in seconds) at which various /// statistics are logged. Note that there is a minimum period of /// 10 seconds. diff --git a/docs/config/lua/config/use_arrow_mouse_cursor_when_mouse_reporting.md b/docs/config/lua/config/use_arrow_mouse_cursor_when_mouse_reporting.md new file mode 100644 index 000000000..a5af27e0b --- /dev/null +++ b/docs/config/lua/config/use_arrow_mouse_cursor_when_mouse_reporting.md @@ -0,0 +1,13 @@ +# `use_arrow_mouse_cursor_when_mouse_reporting` + +{{since('nightly')}} + +If `true`, the mouse cursor will be overridden to be an arrow +when the application enables mouse reporting. Otherwise, it +will remain as the text cursor (an I-beam). + +The default is `true`. + +```lua +config.use_arrow_mouse_cursor_when_mouse_reporting = true +``` diff --git a/wezterm-gui/src/termwindow/mouseevent.rs b/wezterm-gui/src/termwindow/mouseevent.rs index 559d41a65..a1e103ed7 100644 --- a/wezterm-gui/src/termwindow/mouseevent.rs +++ b/wezterm-gui/src/termwindow/mouseevent.rs @@ -824,7 +824,9 @@ impl super::TermWindow { // When hovering over a hyperlink, show an appropriate // mouse cursor to give the cue that it is clickable MouseCursor::Hand - } else if pane.is_mouse_grabbed() || outside_window { + } else if outside_window + || (self.config.use_arrow_mouse_cursor_when_mouse_reporting && pane.is_mouse_grabbed()) + { MouseCursor::Arrow } else { MouseCursor::Text