diff --git a/local.c b/local.c index 87031e1e..a780aa39 100644 --- a/local.c +++ b/local.c @@ -1,4 +1,4 @@ -/* $Id: local.c,v 1.12 2007-10-01 14:18:42 nicm Exp $ */ +/* $Id: local.c,v 1.13 2007-10-02 15:13:59 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -17,6 +17,7 @@ */ #include +#include #include #include @@ -288,12 +289,20 @@ local_cmp(const void *ptr1, const void *ptr2) void local_done(void) { + struct winsize ws; + xfree(local_in); xfree(local_out); if (tcsetattr(local_fd, TCSANOW, &local_tio) != 0) fatal("tcsetattr failed"); close(local_fd); + + if (change_scroll_region != NULL) { + if (ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) == -1) + fatal("ioctl(TIOCGWINSZ)"); + putp(tparm(change_scroll_region, 0, ws.ws_row - 1)); + } if (keypad_local != NULL) putp(keypad_local); /* not local_putp */