aboutsummaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-07-14 06:40:33 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-07-14 06:40:33 +0000
commite63567d51ce76e45013b4a392eba1443fd5b3493 (patch)
tree12a2ff2c3c03c37d7a7c15adc08de027cc07bd45 /window.c
parentf41ef2198ba430a7b376c205ad799fcc0f5b2685 (diff)
downloadrtmux-e63567d51ce76e45013b4a392eba1443fd5b3493.tar.gz
rtmux-e63567d51ce76e45013b4a392eba1443fd5b3493.tar.bz2
rtmux-e63567d51ce76e45013b4a392eba1443fd5b3493.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 'window.c')
-rw-r--r--window.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/window.c b/window.c
index 05abeede..6473120d 100644
--- a/window.c
+++ b/window.c
@@ -1,4 +1,4 @@
-/* $Id: window.c,v 1.89 2009-07-08 18:03:03 nicm Exp $ */
+/* $Id: window.c,v 1.90 2009-07-14 06:40:33 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -405,6 +405,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;
@@ -423,6 +425,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);