Fix key-presses mapped to CSI codes not respecting SC81t mode

This commit is contained in:
Kovid Goyal 2017-12-05 11:03:51 +05:30
parent c95418a947
commit 138bfcf2a8
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -140,7 +140,11 @@ send_key_to_child(Window *w, int key, int mods, int action) {
const char *data = key_to_bytes(key, screen->modes.mDECCKM, screen->modes.mEXTENDED_KEYBOARD, mods, action);
if (data) {
if (screen->modes.mEXTENDED_KEYBOARD) write_escape_code_to_child(screen, APC, data + 1);
else schedule_write_to_child(w->id, (data + 1), *data);
else {
if (*data > 2 && data[1] == 0x1b && data[2] == '[') { // CSI code
write_escape_code_to_child(screen, CSI, data + 3);
} else schedule_write_to_child(w->id, (data + 1), *data);
}
}
}