summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/tty.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2023-01-12 18:49:12 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2023-01-12 18:49:12 +0000
commit6f440661e20462e0cea870fb7691e99cd8b8a0ca (patch)
tree71b1d2ab8501f6b03aadd2c42644359f0e145040 /usr.bin/tmux/tty.c
parent33f44e3eba8e5347e091578a84eeea32b389ebe6 (diff)
Have tmux recognise pasted texts wrapped in bracket paste sequences,
rather than only forwarding them to the program inside. From Andrew Onyshchuk in GitHub issue 3431.
Diffstat (limited to 'usr.bin/tmux/tty.c')
-rw-r--r--usr.bin/tmux/tty.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c
index a810aede094..dea11be7058 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.426 2023/01/03 11:43:24 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.427 2023/01/12 18:49:11 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -341,6 +341,8 @@ tty_start_tty(struct tty *tty)
tty_puts(tty, "\033[?1000l\033[?1002l\033[?1003l");
tty_puts(tty, "\033[?1006l\033[?1005l");
}
+ if (tty_term_has(tty->term, TTYC_ENBP))
+ tty_putcode(tty, TTYC_ENBP);
evtimer_set(&tty->start_timer, tty_start_timer_callback, tty);
evtimer_add(&tty->start_timer, &tv);
@@ -417,8 +419,6 @@ tty_stop_tty(struct tty *tty)
else if (tty_term_has(tty->term, TTYC_SS))
tty_raw(tty, tty_term_string1(tty->term, TTYC_SS, 0));
}
- if (tty->mode & MODE_BRACKETPASTE)
- tty_raw(tty, tty_term_string(tty->term, TTYC_DSBP));
if (tty->ccolour != -1)
tty_raw(tty, tty_term_string(tty->term, TTYC_CR));
@@ -427,6 +427,8 @@ tty_stop_tty(struct tty *tty)
tty_raw(tty, "\033[?1000l\033[?1002l\033[?1003l");
tty_raw(tty, "\033[?1006l\033[?1005l");
}
+ if (tty_term_has(tty->term, TTYC_DSBP))
+ tty_raw(tty, tty_term_string(tty->term, TTYC_DSBP));
if (tty->term->flags & TERM_VT100LIKE)
tty_raw(tty, "\033[?7727l");
@@ -825,12 +827,6 @@ tty_update_mode(struct tty *tty, int mode, struct screen *s)
else if (mode & MODE_MOUSE_STANDARD)
tty_puts(tty, "\033[?1000h");
}
- if (changed & MODE_BRACKETPASTE) {
- if (mode & MODE_BRACKETPASTE)
- tty_putcode(tty, TTYC_ENBP);
- else
- tty_putcode(tty, TTYC_DSBP);
- }
tty->mode = mode;
}