dcs: sort of implement DCS passthrough

We now store the passthrough characters in a buffer, and call
dcs_passthrough() on unhook.

However, dcs_passthrough() doesn't do anything.
This commit is contained in:
Daniel Eklöf 2019-07-19 09:55:07 +02:00
parent 153628a217
commit b953326768
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
6 changed files with 62 additions and 4 deletions

20
vt.c
View file

@ -9,8 +9,9 @@
#define LOG_ENABLE_DBG 0
#include "log.h"
#include "csi.h"
#include "osc.h"
#include "dcs.h"
#include "grid.h"
#include "osc.h"
/* https://vt100.net/emu/dec_ansi_parser */
@ -923,10 +924,21 @@ action(struct terminal *term, enum action _action, uint8_t c)
break;
case ACTION_HOOK:
case ACTION_UNHOOK:
term->vt.dcs.idx = 0;
break;
case ACTION_PUT:
LOG_ERR("unimplemented: action %s", action_names[_action]);
abort();
if (!dcs_ensure_size(term, term->vt.dcs.idx + 1))
break;
term->vt.dcs.data[term->vt.dcs.idx++] = c;
break;
case ACTION_UNHOOK:
if (!dcs_ensure_size(term, term->vt.dcs.idx + 1))
break;
term->vt.dcs.data[term->vt.dcs.idx] = '\0';
dcs_passthrough(term);
break;
case ACTION_UTF8_2_ENTRY:
term->vt.utf8.idx = 0;