Add a feature for bracketed paste.

This commit is contained in:
Nicholas Marriott
2020-04-24 07:13:02 +01:00
parent 2d8fd35de2
commit 5d69b9c4a7
5 changed files with 29 additions and 11 deletions

6
tty.c
View File

@ -407,7 +407,7 @@ tty_stop_tty(struct tty *tty)
tty_raw(tty, tty_term_string1(tty->term, TTYC_SS, 0));
}
if (tty->mode & MODE_BRACKETPASTE)
tty_raw(tty, "\033[?2004l");
tty_raw(tty, tty_term_string(tty->term, TTYC_DSBP));
if (*tty->ccolour != '\0')
tty_raw(tty, tty_term_string(tty->term, TTYC_CR));
@ -729,9 +729,9 @@ tty_update_mode(struct tty *tty, int mode, struct screen *s)
}
if (changed & MODE_BRACKETPASTE) {
if (mode & MODE_BRACKETPASTE)
tty_puts(tty, "\033[?2004h");
tty_putcode(tty, TTYC_ENBP);
else
tty_puts(tty, "\033[?2004l");
tty_putcode(tty, TTYC_DSBP);
}
tty->mode = mode;
}