diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-07-13 10:43:53 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-07-13 10:43:53 +0000 |
commit | 3b86c193d95e633ff0e65671513fc1a762e8d569 (patch) | |
tree | a06d7b73ad58380a65dd71108691bc68d02c7776 /usr.bin/tmux/window.c | |
parent | 2c70086ac6c34217b330a1710ab3417cee0adb7e (diff) |
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.c | 6 |
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); |