summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/window.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2009-07-13 10:43:52 +0000
committernicm <nicm@openbsd.org>2009-07-13 10:43:52 +0000
commit953d773c2d1670addaf5d087f9b8c5e2e0f834e3 (patch)
tree7214a835bd80dbb0ee7edfb216df61c54030006f /usr.bin/tmux/window.c
parentsync (diff)
downloadwireguard-openbsd-953d773c2d1670addaf5d087f9b8c5e2e0f834e3.tar.xz
wireguard-openbsd-953d773c2d1670addaf5d087f9b8c5e2e0f834e3.zip
Support "alternate screen" mode (terminfo smcup/rmcup) typically used by full
screen interactive programs to preserve the screen contents. When activated, it saves a copy of the visible grid and disables scrolling into and resizing out of the history; when deactivated the visible data is restored and the history reenabled.
Diffstat (limited to 'usr.bin/tmux/window.c')
-rw-r--r--usr.bin/tmux/window.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c
index 616e5032f87..0a0325d91b9 100644
--- a/usr.bin/tmux/window.c
+++ b/usr.bin/tmux/window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window.c,v 1.8 2009/07/08 05:26:45 nicm Exp $ */
+/* $OpenBSD: window.c,v 1.9 2009/07/13 10:43:52 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -407,6 +407,8 @@ window_pane_create(struct window *w, u_int sx, u_int sy, u_int hlimit)
wp->sx = sx;
wp->sy = sy;
+ wp->saved_grid = NULL;
+
screen_init(&wp->base, sx, sy, hlimit);
wp->screen = &wp->base;
@@ -425,6 +427,8 @@ window_pane_destroy(struct window_pane *wp)
window_pane_reset_mode(wp);
screen_free(&wp->base);
+ if (wp->saved_grid != NULL)
+ grid_destroy(wp->saved_grid);
buffer_destroy(wp->in);
buffer_destroy(wp->out);