From 8308887d2133d387a0dee2eb0e554ba5ff2db5bf Mon Sep 17 00:00:00 2001 From: eaglgenes101 Date: Fri, 10 Mar 2023 09:38:51 -0500 Subject: [PATCH] Add config option for scrolling the tab bar --- config/src/config.rs | 3 +++ wezterm-gui/src/termwindow/mouseevent.rs | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/config/src/config.rs b/config/src/config.rs index 5dbaf81af..48fdebba6 100644 --- a/config/src/config.rs +++ b/config/src/config.rs @@ -404,6 +404,9 @@ pub struct Config { #[dynamic(default)] pub tab_bar_at_bottom: bool, + + #[dynamic(default)] + pub scroll_tabs: bool, /// If true, tab bar titles are prefixed with the tab index #[dynamic(default = "default_true")] diff --git a/wezterm-gui/src/termwindow/mouseevent.rs b/wezterm-gui/src/termwindow/mouseevent.rs index d0e5272f8..e3a0862d7 100644 --- a/wezterm-gui/src/termwindow/mouseevent.rs +++ b/wezterm-gui/src/termwindow/mouseevent.rs @@ -448,8 +448,10 @@ impl super::TermWindow { TabBarItem::Tab { .. } | TabBarItem::NewTabButton { .. } => {} }, WMEK::VertWheel(n) => { - self.activate_tab_relative(if n < 1 { 1 } else { -1 }, true) - .ok(); + if self.config.scroll_tabs { + self.activate_tab_relative(if n < 1 { 1 } else { -1 }, true) + .ok(); + } } _ => {} }