aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-11-04 14:13:03 +0100
committerPřemysl Eric Janouch <p@janouch.name>2021-11-04 14:14:56 +0100
commit8265f075b176b33680012094aa1ced5721e55ac9 (patch)
treedb202d60dddbf2b20af4d88a335394aca2f0f169
parent2f348c79b702a2403b35bf33e91f57cfbf1bdd5c (diff)
downloadtermo-8265f075b176b33680012094aa1ced5721e55ac9.tar.gz
termo-8265f075b176b33680012094aa1ced5721e55ac9.tar.xz
termo-8265f075b176b33680012094aa1ced5721e55ac9.zip
Fix mouse when key_mouse contains 1006 sequence
-rw-r--r--driver-ti.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/driver-ti.c b/driver-ti.c
index 44eed11..4caec50 100644
--- a/driver-ti.c
+++ b/driver-ti.c
@@ -250,26 +250,24 @@ load_terminfo (termo_ti_t *ti, const char *term)
else
ti->set_mouse_string = strdup (set_mouse_string);
- bool have_mouse = false;
- if (!mouse_report_string && strstr (term, "xterm"))
- mouse_report_string = "\x1b[M";
+ // We handle 1006 and 1015 unconditionally in driver-csi.c,
+ // and don't want to have the handling diverted by recent terminfo;
+ // let's hardcode the ancient 1000 sequence locally
if (mouse_report_string)
{
- have_mouse = true;
-
trie_node_t *node = malloc (sizeof *node);
if (!node)
goto fail;
node->type = TYPE_MOUSE;
- if (!insert_seq (ti, mouse_report_string, node))
+ if (!insert_seq (ti, "\x1b[M", node))
{
free (node);
goto fail;
}
}
- if (!have_mouse)
+ if (!mouse_report_string && strstr (term, "xterm") != term)
ti->tk->guessed_mouse_proto = TERMO_MOUSE_PROTO_NONE;
else if (strstr (term, "rxvt") == term)
// urxvt didn't understand the SGR protocol until version 9.25,