ref: a233e9b49a66f59b9d3ebc828600fd6a5d73b52c
parent: 7d624239f850bc5eb08297e8d560edd82e416740
author: cancel <cancel@cancel.fm>
date: Mon Dec 10 12:23:37 EST 2018
Cleanup
--- a/tui_main.c
+++ b/tui_main.c
@@ -1158,12 +1158,15 @@
}
mousemask(ALL_MOUSE_EVENTS | REPORT_MOUSE_POSITION, NULL);
- // some sequence to hopefully make terminal report mouse movement events.
- // 'REPORT_MOUSE_POSITION' alone in the mousemask doesn't seem to work, at
- // least not for xterm.
- printf("\033[?1003h\n");
- // no waiting for distinguishing click from press
- mouseinterval(0);
+ if (has_mouse()) {
+ // some sequence to hopefully make terminal report mouse movement events.
+ // 'REPORT_MOUSE_POSITION' alone in the mousemask doesn't seem to work, at
+ // least not for xterm.
+ printf("\033[?1003h\n");
+ // use printf("\033[?1003l\n"); to disable
+ // no waiting for distinguishing click from press
+ mouseinterval(0);
+ }
WINDOW* cont_win = NULL;
int key = KEY_RESIZE;