aboutsummaryrefslogtreecommitdiff
path: root/driver-ti.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-06-29 05:10:33 +0200
committerPřemysl Eric Janouch <p@janouch.name>2021-06-29 05:10:33 +0200
commitd39c35e59e6e541cf1f8e2479c77203f6214e5e6 (patch)
tree301c31618980fbedd11c4b8f7a89145db3690767 /driver-ti.c
parentd47bcfb20342615196d8ae6f64bef1cf4d72bbcb (diff)
downloadtermo-d39c35e59e6e541cf1f8e2479c77203f6214e5e6.tar.gz
termo-d39c35e59e6e541cf1f8e2479c77203f6214e5e6.tar.xz
termo-d39c35e59e6e541cf1f8e2479c77203f6214e5e6.zip
Enable focus tracking opportunistically
Diffstat (limited to 'driver-ti.c')
-rw-r--r--driver-ti.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/driver-ti.c b/driver-ti.c
index 6dbdfc1..00c9ad8 100644
--- a/driver-ti.c
+++ b/driver-ti.c
@@ -364,6 +364,8 @@ mouse_reset (termo_ti_t *ti)
&& write_string (ti->tk, "\x1b[?1002l")
&& write_string (ti->tk, "\x1b[?1003l")
+ && write_string (ti->tk, "\x1b[?1004l")
+
&& write_string (ti->tk, "\x1b[?1005l")
&& write_string (ti->tk, "\x1b[?1006l")
&& write_string (ti->tk, "\x1b[?1015l");
@@ -411,8 +413,12 @@ start_driver (termo_t *tk, void *info)
// Disable everything mouse-related first
if (!mouse_reset (ti))
return false;
+
+ // Enable focus tracking opportunistically and automatically,
+ // as it basically doesn't have any negative consequences at all
return mouse_set_proto (ti, tk->mouse_proto, true)
- && mouse_set_tracking_mode (ti, tk->mouse_tracking, true);
+ && mouse_set_tracking_mode (ti, tk->mouse_tracking, true)
+ && write_string (ti->tk, "\x1b[?1004h");
}
static int