=== modified file 'driver-csi.c' --- driver-csi.c 2012-11-30 15:36:06 +0000 +++ driver-csi.c 2012-11-30 15:31:04 +0000 @@ -258,27 +258,19 @@ /* * Handler for CSI R position reports - * A plain CSI R with no arguments is probably actually */ static TermKeyResult handle_csi_R(TermKey *tk, TermKeyKey *key, int cmd, long *arg, int args) { switch(cmd) { case 'R': - switch(args) { - case 0: - key->type = TERMKEY_TYPE_FUNCTION; - key->code.number = 3; - return TERMKEY_RES_KEY; - - case 2: - key->type = TERMKEY_TYPE_POSITION; - termkey_key_set_linecol(key, arg[1], arg[0]); - return TERMKEY_RES_KEY; - - default: - return TERMKEY_RES_NONE; - } + if(args < 2) + return TERMKEY_RES_NONE; + + key->type = TERMKEY_TYPE_POSITION; + termkey_key_set_linecol(key, arg[1], arg[0]); + + return TERMKEY_RES_KEY; default: return TERMKEY_RES_NONE; } === modified file 't/31position.c' --- t/31position.c 2012-11-30 15:36:06 +0000 +++ t/31position.c 2012-04-25 17:34:47 +0000 @@ -7,7 +7,7 @@ TermKeyKey key; int line, col; - plan_tests(8); + plan_tests(5); tk = termkey_new_abstract("vt100", 0); @@ -22,16 +22,6 @@ is_int(line, 15, "line for position report"); is_int(col, 7, "column for position report"); - /* A plain CSI R is likely to be though. - * This is tricky :/ - */ - termkey_push_bytes(tk, "\e[R", 3); - - is_int(termkey_getkey(tk, &key), TERMKEY_RES_KEY, "getkey yields RES_KEY for "); - - is_int(key.type, TERMKEY_TYPE_FUNCTION, "key.type for "); - is_int(key.code.number, 3, "key.code.number for "); - termkey_destroy(tk); return exit_status();