=== modified file 'driver-csi.c' --- driver-csi.c 2012-04-24 14:58:37 +0000 +++ driver-csi.c 2012-04-24 14:25:17 +0000 @@ -140,6 +140,23 @@ static void *new_driver(TermKey *tk, const char *term) { + if(strncmp(term, "xterm", 5) == 0) { + // We want "xterm" or "xtermc" or "xterm-..." + if(term[5] != 0 && term[5] != '-' && term[5] != 'c') + return NULL; + } + else if(strcmp(term, "screen") == 0) { + /* Also apply for screen, because it might be transporting xterm-like + * sequences. Yes, this sucks. We shouldn't need to rely on this behaviour + * but there's no other way to know, and if we don't then we won't + * recognise its sequences. + */ + } + else + return NULL; + + // Excellent - we'll continue + if(!keyinfo_initialised) if(!register_keys()) return NULL; === modified file 't/02getkey.c' --- t/02getkey.c 2012-04-24 14:58:37 +0000 +++ t/02getkey.c 2012-01-26 12:55:34 +0000 @@ -6,7 +6,7 @@ TermKey *tk; TermKeyKey key; - plan_tests(31); + plan_tests(27); tk = termkey_new_abstract("vt100", 0); @@ -61,14 +61,6 @@ is_int(termkey_get_buffer_remaining(tk), 256, "buffer free 256 after completion"); - termkey_push_bytes(tk, "\033[27;5u", 7); - - is_int(termkey_getkey(tk, &key), TERMKEY_RES_KEY, "getkey yields RES_KEY after Ctrl-Escape"); - - is_int(key.type, TERMKEY_TYPE_KEYSYM, "key.type after Ctrl-Escape"); - is_int(key.code.sym, TERMKEY_SYM_ESCAPE, "key.code.sym after Ctrl-Escape"); - is_int(key.modifiers, TERMKEY_KEYMOD_CTRL, "key.modifiers after Ctrl-Escape"); - termkey_destroy(tk); return exit_status(); === modified file 't/30mouse.c' --- t/30mouse.c 2012-04-24 14:58:37 +0000 +++ t/30mouse.c 2012-04-12 16:02:45 +0000 @@ -12,7 +12,8 @@ plan_tests(60); - tk = termkey_new_abstract("vt100", 0); + /* vt100 doesn't have a mouse, we need xterm */ + tk = termkey_new_abstract("xterm", 0); termkey_push_bytes(tk, "\e[M !!", 6);