summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2020-04-07 13:55:24 +0000
committernicm <nicm@openbsd.org>2020-04-07 13:55:24 +0000
commita6732819c0f0c29b7dab11c529619149ca0bbd68 (patch)
tree9cfc26934c142141d503ca8de1314b4b8f7fb0e0
parentDo not send mouse events if the program has not requested them. (diff)
downloadwireguard-openbsd-a6732819c0f0c29b7dab11c529619149ca0bbd68.tar.xz
wireguard-openbsd-a6732819c0f0c29b7dab11c529619149ca0bbd68.zip
Do not restore history flag if it was never set.
-rw-r--r--usr.bin/tmux/screen.c6
-rw-r--r--usr.bin/tmux/tmux.h3
2 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/tmux/screen.c b/usr.bin/tmux/screen.c
index e7437795c14..4ab88b4ff6e 100644
--- a/usr.bin/tmux/screen.c
+++ b/usr.bin/tmux/screen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen.c,v 1.59 2020/03/31 07:00:34 nicm Exp $ */
+/* $OpenBSD: screen.c,v 1.60 2020/04/07 13:55:24 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -536,6 +536,7 @@ screen_alternate_on(struct screen *s, struct grid_cell *gc, int cursor)
grid_view_clear(s->grid, 0, 0, sx, sy, 8);
+ s->saved_flags = s->grid->flags;
s->grid->flags &= ~GRID_HISTORY;
}
@@ -579,7 +580,8 @@ screen_alternate_off(struct screen *s, struct grid_cell *gc, int cursor)
* Turn history back on (so resize can use it) and then resize back to
* the current size.
*/
- s->grid->flags |= GRID_HISTORY;
+ if (s->saved_flags & GRID_HISTORY)
+ s->grid->flags |= GRID_HISTORY;
if (sy > s->saved_grid->sy || sx != s->saved_grid->sx)
screen_resize(s, sx, sy, 1);
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index 4670323fa38..220adec7ad1 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.974 2020/04/06 17:51:34 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.975 2020/04/07 13:55:24 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -761,6 +761,7 @@ struct screen {
u_int saved_cy;
struct grid *saved_grid;
struct grid_cell saved_cell;
+ int saved_flags;
bitstr_t *tabs;
struct screen_sel *sel;