aboutsummaryrefslogtreecommitdiff
path: root/vt.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-07-19 07:55:07 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-07-19 07:55:07 +0000
commitb95332676863d902e410b04305ceb20760297fa3 (patch)
tree51b3feb3c474c7fe5c9e7bffd040a23e05ce5952 /vt.c
parentosc: allocate data buffer dynamically (diff)
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.
Diffstat (limited to 'vt.c')
-rw-r--r--vt.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/vt.c b/vt.c
index 8899fc74..585e9cde 100644
--- a/vt.c
+++ b/vt.c
@@ -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;