diff options
author | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2012-04-24 17:27:48 +0100 |
---|---|---|
committer | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2012-04-24 17:27:48 +0100 |
commit | f5cbf9eb57b0dd38ed8054eff02defec1602f57a (patch) | |
tree | 8f5d412e6ce36cd3639600d1b6aa92b819bf07f4 /t | |
parent | 6645ee971807c5257ca50b073d1dee4af0630fc7 (diff) | |
download | termo-f5cbf9eb57b0dd38ed8054eff02defec1602f57a.tar.gz termo-f5cbf9eb57b0dd38ed8054eff02defec1602f57a.tar.xz termo-f5cbf9eb57b0dd38ed8054eff02defec1602f57a.zip |
Also handle CSI R; position report replies to CSI 6n
Diffstat (limited to 't')
-rw-r--r-- | t/31position.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/t/31position.c b/t/31position.c new file mode 100644 index 0000000..baefb8b --- /dev/null +++ b/t/31position.c @@ -0,0 +1,28 @@ +#include "../termkey.h" +#include "taplib.h" + +int main(int argc, char *argv[]) +{ + TermKey *tk; + TermKeyKey key; + int line, col; + + plan_tests(5); + + tk = termkey_new_abstract("vt100", 0); + + termkey_push_bytes(tk, "\e[15;7R", 7); + + is_int(termkey_getkey(tk, &key), TERMKEY_RES_KEY, "getkey yields RES_KEY for position report"); + + is_int(key.type, TERMKEY_TYPE_POSITION, "key.type for position report"); + + is_int(termkey_interpret_position(tk, &key, &line, &col), TERMKEY_RES_KEY, "interpret_position yields RES_KEY"); + + is_int(line, 7, "line for position report"); + is_int(col, 15, "column for position report"); + + termkey_destroy(tk); + + return exit_status(); +} |