summaryrefslogtreecommitdiffstats
path: root/tty.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2010-05-31 19:51:29 +0000
committerNicholas Marriott <nicm@openbsd.org>2010-05-31 19:51:29 +0000
commit43fa9a9ba60f0fba1f5c7985ed9c65cea304d2c4 (patch)
tree89dc06ea00452e3f6e440d6875016ee9d0910c66 /tty.c
parente1e120de1c4fc5f37940ba3a6567acc914f1692c (diff)
When the mode-mouse option is on, support dragging to make a selection
in copy mode. Also support the scroll wheel, although xterm strangely does not ignore it in application mouse mode, causing redraw artifacts when scrolling up (other terminals appear to be better behaved).
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/tty.c b/tty.c
index 72be2c84..92ddf41f 100644
--- a/tty.c
+++ b/tty.c
@@ -402,11 +402,18 @@ tty_update_mode(struct tty *tty, int mode)
else
tty_putcode(tty, TTYC_CIVIS);
}
- if (changed & MODE_MOUSE) {
- if (mode & MODE_MOUSE)
- tty_puts(tty, "\033[?1000h");
- else
- tty_puts(tty, "\033[?1000l");
+ if (changed & (MODE_MOUSE|MODE_MOUSEMOTION)) {
+ if (mode & MODE_MOUSE) {
+ if (mode & MODE_MOUSEMOTION)
+ tty_puts(tty, "\033[?1003h");
+ else
+ tty_puts(tty, "\033[?1000h");
+ } else {
+ if (mode & MODE_MOUSEMOTION)
+ tty_puts(tty, "\033[?1003l");
+ else
+ tty_puts(tty, "\033[?1000l");
+ }
}
if (changed & MODE_KKEYPAD) {
if (mode & MODE_KKEYPAD)