diff --git a/tty.c b/tty.c index bd1c92b0..75942d2d 100644 --- a/tty.c +++ b/tty.c @@ -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));