diff options
author | 2020-01-13 11:59:21 +0000 | |
---|---|---|
committer | 2020-01-13 11:59:21 +0000 | |
commit | 4d13fbf7bf62bac65f19a78e316eff37a2d6d005 (patch) | |
tree | 7ba071a362deb868c40e0bbd96b100f81ab33e85 /usr.bin/tmux/tty.c | |
parent | Add the capability to boot from another block device than the one that (diff) | |
download | wireguard-openbsd-4d13fbf7bf62bac65f19a78e316eff37a2d6d005.tar.xz wireguard-openbsd-4d13fbf7bf62bac65f19a78e316eff37a2d6d005.zip |
Stop handling DA and DSR after a second (they should be the first thing
sent) so this should be plenty.
Diffstat (limited to 'usr.bin/tmux/tty.c')
-rw-r--r-- | usr.bin/tmux/tty.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index 5366c0e6228..a73d01687ec 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.339 2020/01/13 08:12:53 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.340 2020/01/13 11:59:21 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -285,11 +285,22 @@ tty_open(struct tty *tty, char **cause) return (0); } +static void +tty_start_timer_callback(__unused int fd, __unused short events, void *data) +{ + struct tty *tty = data; + struct client *c = tty->client; + + log_debug("%s: start timer fired", c->name); + tty->flags |= (TTY_HAVEDA|TTY_HAVEDSR); +} + void tty_start_tty(struct tty *tty) { struct client *c = tty->client; struct termios tio; + struct timeval tv = { .tv_sec = 1 }; if (tty->fd != -1 && tcgetattr(tty->fd, &tty->tio) == 0) { setblocking(tty->fd, 0); @@ -328,9 +339,13 @@ tty_start_tty(struct tty *tty) tty_puts(tty, "\033[?1004h"); } tty_puts(tty, "\033[c\033[1337n"); /* DA and DSR */ + } else tty->flags |= (TTY_HAVEDA|TTY_HAVEDSR); + evtimer_set(&tty->start_timer, tty_start_timer_callback, tty); + evtimer_add(&tty->start_timer, &tv); + tty->flags |= TTY_STARTED; tty_invalidate(tty); @@ -351,6 +366,8 @@ tty_stop_tty(struct tty *tty) return; tty->flags &= ~TTY_STARTED; + evtimer_del(&tty->start_timer); + event_del(&tty->timer); tty->flags &= ~TTY_BLOCK; |