mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-16 16:41:35 +02:00
When mode-mouse is on (it is off by default), automatically enter copy
mode when the mouse is dragged or the mouse wheel is used. Also exit copy mode when the mouse wheel is scrolled off the bottom. Discussed with and written by hsim at gmx dot li.
This commit is contained in:
@ -220,5 +220,12 @@ input_mouse(struct window_pane *wp, struct mouse_event *m)
|
||||
buf[len++] = m->y + 33;
|
||||
}
|
||||
bufferevent_write(wp->event, buf, len);
|
||||
} else if ((m->b & MOUSE_BUTTON) != MOUSE_2) {
|
||||
if (options_get_number(&wp->window->options, "mode-mouse") &&
|
||||
window_pane_set_mode(wp, &window_copy_mode) == 0) {
|
||||
window_copy_init_from_pane(wp);
|
||||
if (wp->mode->mouse != NULL)
|
||||
wp->mode->mouse(wp, NULL, m);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user