aboutsummaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2021-12-31 14:01:10 +0000
committerThomas Adam <thomas@xteddy.org>2021-12-31 14:01:10 +0000
commit080079c55a7f94af5ead4fad71ee2b33f54b154b (patch)
treeda6594750f5b8f27bb74d4787bcfdbcc3d5a48cc /tty.c
parent47923bd5f62f49924e20f3cabcff9350968449a2 (diff)
parente6e3c75ed70adece8b1cf93017f6f359d022bdb0 (diff)
downloadrtmux-080079c55a7f94af5ead4fad71ee2b33f54b154b.tar.gz
rtmux-080079c55a7f94af5ead4fad71ee2b33f54b154b.tar.bz2
rtmux-080079c55a7f94af5ead4fad71ee2b33f54b154b.zip
Merge branch 'obsd-master' into master
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/tty.c b/tty.c
index 3aefe784..8410a64c 100644
--- a/tty.c
+++ b/tty.c
@@ -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)