From bae92ec6e921e6f16d040d805a371e027dd9a23f Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Fri, 15 Nov 2024 09:01:17 +0000 Subject: Turn off scrollbar when pane is in alternate screen, from Michael Grant, GitHub issue 4231. --- usr.bin/tmux/window.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'usr.bin/tmux/window.c') diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c index e916410608c..f30a30ffd91 100644 --- a/usr.bin/tmux/window.c +++ b/usr.bin/tmux/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.296 2024/11/05 09:41:17 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.297 2024/11/15 09:01:16 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -1726,3 +1726,16 @@ window_pane_mode(struct window_pane *wp) } return (WINDOW_PANE_NO_MODE); } + +/* Return 1 if scrollbar is or should be displayed. */ +int +window_pane_show_scrollbar(struct window_pane *wp, int sb_option) +{ + if (SCREEN_IS_ALTERNATE(wp->screen)) + return (0); + if (sb_option == PANE_SCROLLBARS_ALWAYS || + (sb_option == PANE_SCROLLBARS_MODAL && + window_pane_mode(wp) != WINDOW_PANE_NO_MODE)) + return (1); + return (0); +} -- cgit v1.2.3