diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-11-27 19:43:50 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-11-27 19:43:50 +0000 |
commit | 2fabfb30b0275a0adc7b5bc0a260ab830d1f41ed (patch) | |
tree | 64a5f000de438e60e16af03b4ebe33634b83da1a /tty.c | |
parent | 80e30f693c925841b5874063ca1d8aab2c42d231 (diff) | |
download | rtmux-2fabfb30b0275a0adc7b5bc0a260ab830d1f41ed.tar.gz rtmux-2fabfb30b0275a0adc7b5bc0a260ab830d1f41ed.tar.bz2 rtmux-2fabfb30b0275a0adc7b5bc0a260ab830d1f41ed.zip |
Make reset actually work.
Diffstat (limited to 'tty.c')
-rw-r--r-- | tty.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -1,4 +1,4 @@ -/* $Id: tty.c,v 1.2 2007-11-27 19:32:15 nicm Exp $ */ +/* $Id: tty.c,v 1.3 2007-11-27 19:43:50 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -121,7 +121,11 @@ tty_close(struct tty *tty) if (ioctl(tty->fd, TIOCGWINSZ, &ws) == -1) fatal("ioctl(TIOCGWINSZ)"); + if (tcsetattr(tty->fd, TCSANOW, &tty->tio) != 0) + fatal("tcsetattr failed"); + if (change_scroll_region != NULL) + tty_raw(tty, tparm(change_scroll_region, 0, ws.ws_row - 1)); if (keypad_local != NULL) tty_raw(tty, keypad_local); if (exit_ca_mode != NULL) @@ -131,13 +135,8 @@ tty_close(struct tty *tty) tty_raw(tty, cursor_normal); if (exit_attribute_mode != NULL) tty_raw(tty, exit_attribute_mode); - if (change_scroll_region != NULL) - tty_raw(tty, tparm(change_scroll_region, 0, ws.ws_row - 1)); - if (tcsetattr(tty->fd, TCSANOW, &tty->tio) != 0) - fatal("tcsetattr failed"); del_curterm(tty->termp); - tty_keys_free(tty); close(tty->fd); |