termptyesc: handle alternate escape (7728)

This commit is contained in:
Boris Faure 2023-08-14 20:27:53 +02:00
parent 85c6d89414
commit ad5812a70d
Signed by: borisfaure
GPG Key ID: EAA9CD729F522998
4 changed files with 10 additions and 0 deletions

View File

@ -139,6 +139,10 @@ keyin_handle_key_to_pty(Termpty *ty, const Evas_Event_Key_Down *ev,
{
TERMPTY_WRITE_STR("\033O[");
}
else if (ty->termstate.alternate_esc)
{
TERMPTY_WRITE_STR("\034");
}
else
{
if (alt)

View File

@ -133,6 +133,7 @@ typedef struct tag_Term_State {
unsigned int combining_strike : 1;
unsigned int sace_rectangular : 1;
unsigned int esc_keycode : 1;
unsigned int alternate_esc : 1;
int xmod[6];
} Term_State;

View File

@ -547,6 +547,10 @@ _handle_esc_csi_reset_mode(Termpty *ty, Eina_Unicode cc, Eina_Unicode *b,
DBG("%s application escape mode", mode ? "enable" : "disable");
ty->termstate.esc_keycode = !!mode;
break;
case 7728:
DBG("%s alternate escape", mode ? "enable" : "disable");
ty->termstate.alternate_esc = !!mode;
break;
case 7766: // ignore
WRN("TODO: %s scrollbar", mode ? "hide" : "show");
ty->decoding_error = EINA_TRUE;

View File

@ -452,6 +452,7 @@ termpty_soft_reset_state(Termpty *ty)
ty->termstate.hide_cursor = 0;
ty->termstate.sace_rectangular = 0;
ty->termstate.esc_keycode = 0;
ty->termstate.alternate_esc = 0;
ty->mouse_mode = MOUSE_OFF;
ty->mouse_ext = MOUSE_EXT_NONE;
ty->bracketed_paste = 0;