Focus reporting no longer under XT.

This commit is contained in:
Nicholas Marriott 2020-04-24 14:20:17 +01:00
parent a477c03ad5
commit c107708bcc

22
tty.c
View File

@ -330,13 +330,12 @@ tty_start_tty(struct tty *tty)
tty_puts(tty, "\033[?1006l\033[?1005l");
}
if (tty_term_flag(tty->term, TTYC_XT)) {
if (options_get_number(global_options, "focus-events")) {
tty->flags |= TTY_FOCUS;
tty_raw(tty, tty_term_string(tty->term, TTYC_ENFCS));
}
tty_puts(tty, "\033[?7727h");
if (options_get_number(global_options, "focus-events")) {
tty->flags |= TTY_FOCUS;
tty_raw(tty, tty_term_string(tty->term, TTYC_ENFCS));
}
if (tty_term_flag(tty->term, TTYC_XT))
tty_puts(tty, "\033[?7727h");
evtimer_set(&tty->start_timer, tty_start_timer_callback, tty);
evtimer_add(&tty->start_timer, &tv);
@ -417,13 +416,12 @@ tty_stop_tty(struct tty *tty)
tty_raw(tty, "\033[?1006l\033[?1005l");
}
if (tty_term_flag(tty->term, TTYC_XT)) {
if (tty->flags & TTY_FOCUS) {
tty->flags &= ~TTY_FOCUS;
tty_raw(tty, tty_term_string(tty->term, TTYC_DSFCS));
}
tty_raw(tty, "\033[?7727l");
if (tty->flags & TTY_FOCUS) {
tty->flags &= ~TTY_FOCUS;
tty_raw(tty, tty_term_string(tty->term, TTYC_DSFCS));
}
if (tty_term_flag(tty->term, TTYC_XT))
tty_raw(tty, "\033[?7727l");
if (tty_use_margin(tty))
tty_raw(tty, tty_term_string(tty->term, TTYC_DSMG));