diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-02-24 19:08:40 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-02-24 19:08:40 +0000 |
commit | 4a8f04edaf7f4cc40e0101e2a5f41c5f463b55db (patch) | |
tree | 40e30ba6a1bb79d8ab0ccd4a860b2becbaaeb5fc | |
parent | e2bc9ebb99cfaf1f82874d76ab72a939ddaaedcb (diff) |
Don't set the terminal to nonblocking on detach until we have finished with it
entirely.
-rw-r--r-- | usr.bin/tmux/tty.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index 81994b73c74..3f4f1e330c6 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.83 2010/02/01 23:06:24 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.84 2010/02/24 19:08:39 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -213,10 +213,6 @@ tty_stop_tty(struct tty *tty) * because the fd is invalid. Things like ssh -t can easily leave us * with a dead tty. */ - if ((mode = fcntl(tty->fd, F_GETFL)) == -1) - return; - if (fcntl(tty->fd, F_SETFL, mode & ~O_NONBLOCK) == -1) - return; if (ioctl(tty->fd, TIOCGWINSZ, &ws) == -1) return; if (tcsetattr(tty->fd, TCSANOW, &tty->tio) == -1) @@ -233,6 +229,9 @@ tty_stop_tty(struct tty *tty) tty_raw(tty, "\033[?1000l"); tty_raw(tty, tty_term_string(tty->term, TTYC_RMCUP)); + + if ((mode = fcntl(tty->fd, F_GETFL)) != -1) + fcntl(tty->fd, F_SETFL, mode & ~O_NONBLOCK); } void |