version 1.339, 2020/01/13 08:12:53 |
version 1.340, 2020/01/13 11:59:21 |
|
|
return (0); |
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 |
void |
tty_start_tty(struct tty *tty) |
tty_start_tty(struct tty *tty) |
{ |
{ |
struct client *c = tty->client; |
struct client *c = tty->client; |
struct termios tio; |
struct termios tio; |
|
struct timeval tv = { .tv_sec = 1 }; |
|
|
if (tty->fd != -1 && tcgetattr(tty->fd, &tty->tio) == 0) { |
if (tty->fd != -1 && tcgetattr(tty->fd, &tty->tio) == 0) { |
setblocking(tty->fd, 0); |
setblocking(tty->fd, 0); |
|
|
tty_puts(tty, "\033[?1004h"); |
tty_puts(tty, "\033[?1004h"); |
} |
} |
tty_puts(tty, "\033[c\033[1337n"); /* DA and DSR */ |
tty_puts(tty, "\033[c\033[1337n"); /* DA and DSR */ |
|
|
} else |
} else |
tty->flags |= (TTY_HAVEDA|TTY_HAVEDSR); |
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->flags |= TTY_STARTED; |
tty_invalidate(tty); |
tty_invalidate(tty); |
|
|
|
|
if (!(tty->flags & TTY_STARTED)) |
if (!(tty->flags & TTY_STARTED)) |
return; |
return; |
tty->flags &= ~TTY_STARTED; |
tty->flags &= ~TTY_STARTED; |
|
|
|
evtimer_del(&tty->start_timer); |
|
|
event_del(&tty->timer); |
event_del(&tty->timer); |
tty->flags &= ~TTY_BLOCK; |
tty->flags &= ~TTY_BLOCK; |