mirror of
https://github.com/tmux/tmux.git
synced 2026-10-08 02:34:28 +00:00
Send kitty keyboard probe only if extended-keys is not off.
This commit is contained in:
24
tty.c
24
tty.c
@@ -404,11 +404,14 @@ tty_start_tty(struct tty *tty)
|
||||
void
|
||||
tty_send_requests(struct tty *tty)
|
||||
{
|
||||
int ek;
|
||||
|
||||
if (~tty->flags & TTY_STARTED)
|
||||
return;
|
||||
|
||||
if (tty->term->flags & TERM_VT100LIKE) {
|
||||
if (~tty->flags & TTY_HAVEKKB)
|
||||
ek = options_get_number(global_options, "extended-keys");
|
||||
if (ek != 0 && (~tty->flags & TTY_HAVEKKB))
|
||||
tty_puts(tty, "\033[?u");
|
||||
if (~tty->flags & TTY_HAVEDA)
|
||||
tty_puts(tty, "\033[c");
|
||||
@@ -451,6 +454,25 @@ tty_repeat_requests(struct tty *tty, int force)
|
||||
tty_start_start_timer(tty);
|
||||
}
|
||||
|
||||
/* Ask about Kitty keyboard support if extended-keys was turned on later. */
|
||||
void
|
||||
tty_extended_keys_changed(struct tty *tty)
|
||||
{
|
||||
if (~tty->flags & TTY_STARTED)
|
||||
return;
|
||||
tty_update_features(tty);
|
||||
|
||||
if (options_get_number(global_options, "extended-keys") == 0)
|
||||
return;
|
||||
if (~tty->term->flags & TERM_VT100LIKE)
|
||||
return;
|
||||
if (tty->term->flags & TERM_KITTYKEYS)
|
||||
return;
|
||||
tty->flags &= ~TTY_HAVEKKB;
|
||||
tty_puts(tty, "\033[?u");
|
||||
tty_start_start_timer(tty);
|
||||
}
|
||||
|
||||
void
|
||||
tty_stop_tty(struct tty *tty)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user