diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-10-02 15:13:59 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-10-02 15:13:59 +0000 |
commit | 4fbbc3dfd3fd6b26213c52af780fd41a86814b9f (patch) | |
tree | 095354e46e77218a02c0634c0e66b42d217c993a | |
parent | 38589dd2c73e458c20b488ebd3f3d575362b5bc4 (diff) | |
download | rtmux-4fbbc3dfd3fd6b26213c52af780fd41a86814b9f.tar.gz rtmux-4fbbc3dfd3fd6b26213c52af780fd41a86814b9f.tar.bz2 rtmux-4fbbc3dfd3fd6b26213c52af780fd41a86814b9f.zip |
Reset scrolling region on exit.
-rw-r--r-- | local.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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 <nicm@users.sourceforge.net> @@ -17,6 +17,7 @@ */ #include <sys/types.h> +#include <sys/ioctl.h> #include <curses.h> #include <fcntl.h> @@ -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 */ |