mirror of
https://github.com/tmux/tmux.git
synced 2026-10-09 11:44:23 +00:00
Add a flag to turn off scrollbars for display-panes; GitHub issue 5440
from David Marte.
This commit is contained in:
4
tmux.h
4
tmux.h
@@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: tmux.h,v 1.1416 2026/07/27 19:15:58 nicm Exp $ */
|
/* $OpenBSD: tmux.h,v 1.1417 2026/07/29 14:06:32 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
@@ -1160,6 +1160,8 @@ struct window_mode {
|
|||||||
int flags;
|
int flags;
|
||||||
#define WINDOW_MODE_HIDE_PANE_STATUS 0x1
|
#define WINDOW_MODE_HIDE_PANE_STATUS 0x1
|
||||||
#define WINDOW_MODE_NO_STACK 0x2
|
#define WINDOW_MODE_NO_STACK 0x2
|
||||||
|
#define WINDOW_MODE_FILL_WINDOW 0x4
|
||||||
|
#define WINDOW_MODE_HIDE_SCROLLBARS 0x8
|
||||||
|
|
||||||
struct screen *(*init)(struct window_mode_entry *,
|
struct screen *(*init)(struct window_mode_entry *,
|
||||||
struct cmdq_item *, struct cmd_find_state *,
|
struct cmdq_item *, struct cmd_find_state *,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: window-panes.c,v 1.3 2026/07/19 19:53:11 nicm Exp $ */
|
/* $OpenBSD: window-panes.c,v 1.4 2026/07/29 14:06:32 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2026 Nicholas Marriott <nicholas.marriott@gmail.com>
|
* Copyright (c) 2026 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
@@ -35,7 +35,8 @@ static void window_panes_key(struct window_mode_entry *,
|
|||||||
|
|
||||||
const struct window_mode window_panes_mode = {
|
const struct window_mode window_panes_mode = {
|
||||||
.name = "panes-mode",
|
.name = "panes-mode",
|
||||||
.flags = WINDOW_MODE_HIDE_PANE_STATUS|WINDOW_MODE_NO_STACK,
|
.flags = WINDOW_MODE_HIDE_PANE_STATUS|WINDOW_MODE_NO_STACK|
|
||||||
|
WINDOW_MODE_FILL_WINDOW|WINDOW_MODE_HIDE_SCROLLBARS,
|
||||||
|
|
||||||
.init = window_panes_init,
|
.init = window_panes_init,
|
||||||
.free = window_panes_free,
|
.free = window_panes_free,
|
||||||
|
|||||||
18
window.c
18
window.c
@@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: window.c,v 1.368 2026/07/23 09:38:27 nicm Exp $ */
|
/* $OpenBSD: window.c,v 1.369 2026/07/29 14:06:32 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
@@ -2449,11 +2449,21 @@ window_pane_mode(struct window_pane *wp)
|
|||||||
int
|
int
|
||||||
window_pane_show_scrollbar(struct window_pane *wp)
|
window_pane_show_scrollbar(struct window_pane *wp)
|
||||||
{
|
{
|
||||||
|
struct window *w = wp->window;
|
||||||
|
struct window_mode_entry *wme;
|
||||||
|
|
||||||
if (SCREEN_IS_ALTERNATE(&wp->base))
|
if (SCREEN_IS_ALTERNATE(&wp->base))
|
||||||
return (0);
|
return (0);
|
||||||
if (wp->window->sb == PANE_SCROLLBARS_ALWAYS ||
|
if ((w->flags & WINDOW_ZOOMED) && w->active != NULL) {
|
||||||
wp->window->sb == PANE_SCROLLBARS_AUTOHIDE ||
|
wme = TAILQ_FIRST(&w->active->modes);
|
||||||
(wp->window->sb == PANE_SCROLLBARS_MODAL &&
|
if (wme != NULL &&
|
||||||
|
(wme->mode->flags & WINDOW_MODE_HIDE_SCROLLBARS)) {
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (w->sb == PANE_SCROLLBARS_ALWAYS ||
|
||||||
|
w->sb == PANE_SCROLLBARS_AUTOHIDE ||
|
||||||
|
(w->sb == PANE_SCROLLBARS_MODAL &&
|
||||||
window_pane_mode(wp) != WINDOW_PANE_NO_MODE))
|
window_pane_mode(wp) != WINDOW_PANE_NO_MODE))
|
||||||
return (1);
|
return (1);
|
||||||
return (0);
|
return (0);
|
||||||
|
|||||||
Reference in New Issue
Block a user