aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2022-03-19 19:04:11 +0000
committerDaniel Eklöf <daniel@ekloef.se>2022-03-21 19:40:50 +0000
commit8f064369859947fd039531c8e3239fe37656eac8 (patch)
tree5615ac368e2187a98b25859aa53b2813edae6ee7
parentvt: free OSC buffer after dispatch, if larger than 4K (diff)
dcs: map BSU/ESU unhook handlers directly to term_{enable,disable}_app_sync_upates()
That is, drop the local bsu() and esu() functions.
-rw-r--r--dcs.c33
1 files changed, 7 insertions, 26 deletions
diff --git a/dcs.c b/dcs.c
index dbd4ead2..a5feb387 100644
--- a/dcs.c
+++ b/dcs.c
@@ -10,30 +10,6 @@
#include "vt.h"
#include "xmalloc.h"
-static void
-bsu(struct terminal *term)
-{
- /* https://gitlab.com/gnachman/iterm2/-/wikis/synchronized-updates-spec */
-
- size_t n = term->vt.dcs.idx;
- if (unlikely(n > 0))
- LOG_DBG("BSU with unknown params: %.*s)", (int)n, term->vt.dcs.data);
-
- term_enable_app_sync_updates(term);
-}
-
-static void
-esu(struct terminal *term)
-{
- /* https://gitlab.com/gnachman/iterm2/-/wikis/synchronized-updates-spec */
-
- size_t n = term->vt.dcs.idx;
- if (unlikely(n > 0))
- LOG_DBG("ESU with unknown params: %.*s)", (int)n, term->vt.dcs.data);
-
- term_disable_app_sync_updates(term);
-}
-
/* Decode hex-encoded string *inline*. NULL terminates */
static char *
hex_decode(const char *s, size_t len)
@@ -419,9 +395,14 @@ dcs_hook(struct terminal *term, uint8_t final)
case '=':
switch (final) {
case 's':
+ /* BSU/ESU: https://gitlab.com/gnachman/iterm2/-/wikis/synchronized-updates-spec */
switch (vt_param_get(term, 0, 0)) {
- case 1: term->vt.dcs.unhook_handler = &bsu; return;
- case 2: term->vt.dcs.unhook_handler = &esu; return;
+ case 1:
+ term->vt.dcs.unhook_handler = &term_enable_app_sync_updates;
+ return;
+ case 2:
+ term->vt.dcs.unhook_handler = &term_disable_app_sync_updates;
+ return;
}
break;
}