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.
This commit is contained in:
Nicholas Marriott
2009-07-14 06:40:33 +00:00
parent f41ef2198b
commit e63567d51c
6 changed files with 159 additions and 15 deletions

View File

@ -1,4 +1,4 @@
/* $Id: grid-view.c,v 1.17 2009-07-09 18:04:53 nicm Exp $ */
/* $Id: grid-view.c,v 1.18 2009-07-14 06:40:33 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -92,7 +92,7 @@ grid_view_scroll_region_up(struct grid *gd, u_int rupper, u_int rlower)
{
GRID_DEBUG(gd, "rupper=%u, rlower=%u", rupper, rlower);
if (rupper == 0 && rlower == gd->sy - 1) {
if (gd->flags & GRID_HISTORY && rupper == 0 && rlower == gd->sy - 1) {
grid_scroll_line(gd);
return;
}