summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2021-12-31 11:35:50 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2021-12-31 11:35:50 +0000
commitc4723d24dbac272f449750e8cd49e2fe2d03615b (patch)
tree309e88a37b22c6ba9c029da4abe1fa8ba2ea9a5f /usr.bin
parentd05c79fe8564bd414bc91423e94403065a4cabe9 (diff)
Try to turn on less-capable mouse modes when turning on more-capable, to
increase the chances we get something even if the terminal doesn't support the one we really want. GitHub issue 3020.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/tty.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c
index d43097d52d4..63274052d00 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.414 2021/12/10 12:42:37 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.415 2021/12/31 11:35:49 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -791,26 +791,19 @@ tty_update_mode(struct tty *tty, int mode, struct screen *s)
if ((changed & ALL_MOUSE_MODES) && tty_term_has(term, TTYC_KMOUS)) {
/*
- * If the mouse modes have changed, clear any that are set and
- * apply again. There are differences in how terminals track
- * the various bits.
+ * If the mouse modes have changed, clear then all and apply
+ * again. There are differences in how terminals track the
+ * various bits.
*/
- if (tty->mode & MODE_MOUSE_SGR)
- tty_puts(tty, "\033[?1006l");
- if (tty->mode & MODE_MOUSE_STANDARD)
- tty_puts(tty, "\033[?1000l");
- if (tty->mode & MODE_MOUSE_BUTTON)
- tty_puts(tty, "\033[?1002l");
- if (tty->mode & MODE_MOUSE_ALL)
- tty_puts(tty, "\033[?1003l");
+ tty_puts(tty, "\033[?1006l\033[?1000l\033[?1002l\033[?1003l");
if (mode & ALL_MOUSE_MODES)
tty_puts(tty, "\033[?1006h");
- if (mode & MODE_MOUSE_STANDARD)
- tty_puts(tty, "\033[?1000h");
- if (mode & MODE_MOUSE_BUTTON)
- tty_puts(tty, "\033[?1002h");
if (mode & MODE_MOUSE_ALL)
- tty_puts(tty, "\033[?1003h");
+ tty_puts(tty, "\033[?1000h\033[?1002h\033[?1003h");
+ if (mode & MODE_MOUSE_BUTTON)
+ tty_puts(tty, "\033[?1000h\033[?1002h");
+ else if (mode & MODE_MOUSE_STANDARD)
+ tty_puts(tty, "\033[?1000h");
}
if (changed & MODE_BRACKETPASTE) {
if (mode & MODE_BRACKETPASTE)