aboutsummaryrefslogtreecommitdiff
path: root/t/39csi.c
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-11-30 14:43:00 +0000
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-11-30 14:43:00 +0000
commitd5c3d9c8fe500340c081ea3e0a4b575b3369d0dd (patch)
tree27af0469cc7eb81e9413c73c38881754ec35f4c4 /t/39csi.c
parent26912d989b88741cb581ce1d261b096172260886 (diff)
downloadtermo-d5c3d9c8fe500340c081ea3e0a4b575b3369d0dd.tar.gz
termo-d5c3d9c8fe500340c081ea3e0a4b575b3369d0dd.tar.xz
termo-d5c3d9c8fe500340c081ea3e0a4b575b3369d0dd.zip
Also interpret an intermediate CSI byte if present
Diffstat (limited to 't/39csi.c')
-rw-r--r--t/39csi.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/t/39csi.c b/t/39csi.c
index fa9d4a0..9d186f6 100644
--- a/t/39csi.c
+++ b/t/39csi.c
@@ -9,7 +9,7 @@ int main(int argc, char *argv[])
size_t nargs = 16;
unsigned long command;
- plan_tests(11);
+ plan_tests(15);
tk = termkey_new_abstract("vt100", 0);
@@ -31,7 +31,14 @@ int main(int argc, char *argv[])
is_int(termkey_getkey(tk, &key), TERMKEY_RES_KEY, "getkey yields RES_KEY for CSI ? w");
is_int(key.type, TERMKEY_TYPE_UNKNOWN_CSI, "key.type for unknown CSI");
is_int(termkey_interpret_csi(tk, &key, args, &nargs, &command), TERMKEY_RES_KEY, "interpret_csi yields RES_KEY");
- is_int(command, '?' << 8 | 'w', "command for unknown CSI");
+ is_int(command, '?'<<8 | 'w', "command for unknown CSI");
+
+ termkey_push_bytes(tk, "\e[?$x", 5);
+
+ is_int(termkey_getkey(tk, &key), TERMKEY_RES_KEY, "getkey yields RES_KEY for CSI ? $x");
+ is_int(key.type, TERMKEY_TYPE_UNKNOWN_CSI, "key.type for unknown CSI");
+ is_int(termkey_interpret_csi(tk, &key, args, &nargs, &command), TERMKEY_RES_KEY, "interpret_csi yields RES_KEY");
+ is_int(command, '$'<<16 | '?'<<8 | 'x', "command for unknown CSI");
termkey_destroy(tk);