diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-11-27 21:07:38 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-11-27 21:07:38 +0000 |
commit | c6384a765b1113fbff54bc3f0126b3a578730b36 (patch) | |
tree | 3f39fae37a3c479f550ff9e7da3141298eab1e90 /tty.c | |
parent | 7034ba236f4cbb94753f23747e363644a932221e (diff) | |
download | rtmux-c6384a765b1113fbff54bc3f0126b3a578730b36.tar.gz rtmux-c6384a765b1113fbff54bc3f0126b3a578730b36.tar.bz2 rtmux-c6384a765b1113fbff54bc3f0126b3a578730b36.zip |
Flush data on tty open. Also reset colour before clearing line/screen.
Diffstat (limited to 'tty.c')
-rw-r--r-- | tty.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $Id: tty.c,v 1.4 2007-11-27 20:01:30 nicm Exp $ */ +/* $Id: tty.c,v 1.5 2007-11-27 21:07:38 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -51,7 +51,7 @@ int tty_open(struct tty *tty, char **cause) { struct termios tio; - int error; + int error, what; tty->fd = open(tty->path, O_RDWR|O_NONBLOCK); if (tty->fd == -1) { @@ -103,6 +103,10 @@ tty_open(struct tty *tty, char **cause) if (tcsetattr(tty->fd, TCSANOW, &tio) != 0) fatal("tcsetattr failed"); + what = 0; + if (ioctl(tty->fd, TIOCFLUSH, &what) != 0) + fatal("ioctl(TIOCFLUSH)"); + if (enter_ca_mode != NULL) tty_puts(tty, enter_ca_mode); if (keypad_xmit != NULL) |