termptyesc: handle Application Escape Code
Should make your vim more responsive ;)
This commit is contained in:
parent
ea122be0a9
commit
85c6d89414
|
@ -133,6 +133,25 @@ keyin_handle_key_to_pty(Termpty *ty, const Evas_Event_Key_Down *ev,
|
|||
}
|
||||
return;
|
||||
}
|
||||
if (!strcmp(ev->key, "Escape"))
|
||||
{
|
||||
if (ty->termstate.esc_keycode)
|
||||
{
|
||||
TERMPTY_WRITE_STR("\033O[");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (alt)
|
||||
{
|
||||
TERMPTY_WRITE_STR("\x9b");
|
||||
}
|
||||
else
|
||||
{
|
||||
TERMPTY_WRITE_STR("\033");
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!strcmp(ev->key, "Return"))
|
||||
{
|
||||
if (alt)
|
||||
|
|
|
@ -132,6 +132,7 @@ typedef struct tag_Term_State {
|
|||
unsigned int hide_cursor : 1;
|
||||
unsigned int combining_strike : 1;
|
||||
unsigned int sace_rectangular : 1;
|
||||
unsigned int esc_keycode : 1;
|
||||
int xmod[6];
|
||||
} Term_State;
|
||||
|
||||
|
|
|
@ -543,9 +543,9 @@ _handle_esc_csi_reset_mode(Termpty *ty, Eina_Unicode cc, Eina_Unicode *b,
|
|||
WRN("TODO: ambigous width reporting %i", mode);
|
||||
ty->decoding_error = EINA_TRUE;
|
||||
break;
|
||||
case 7727: // ignore
|
||||
WRN("TODO: enable application escape mode %i", mode);
|
||||
ty->decoding_error = EINA_TRUE;
|
||||
case 7727:
|
||||
DBG("%s application escape mode", mode ? "enable" : "disable");
|
||||
ty->termstate.esc_keycode = !!mode;
|
||||
break;
|
||||
case 7766: // ignore
|
||||
WRN("TODO: %s scrollbar", mode ? "hide" : "show");
|
||||
|
|
|
@ -451,6 +451,7 @@ termpty_soft_reset_state(Termpty *ty)
|
|||
ty->termstate.cjk_ambiguous_wide = 0;
|
||||
ty->termstate.hide_cursor = 0;
|
||||
ty->termstate.sace_rectangular = 0;
|
||||
ty->termstate.esc_keycode = 0;
|
||||
ty->mouse_mode = MOUSE_OFF;
|
||||
ty->mouse_ext = MOUSE_EXT_NONE;
|
||||
ty->bracketed_paste = 0;
|
||||
|
|
Loading…
Reference in New Issue