summaryrefslogtreecommitdiffstats
path: root/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'input.c')
-rw-r--r--input.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/input.c b/input.c
index 70a0f5da..821f029a 100644
--- a/input.c
+++ b/input.c
@@ -1446,7 +1446,11 @@ input_csi_dispatch(struct input_ctx *ictx)
case -1:
break;
case 0:
+#ifdef ENABLE_SIXEL
+ input_reply(ictx, "\033[?1;2;4c");
+#else
input_reply(ictx, "\033[?1;2c");
+#endif
break;
default:
log_debug("%s: unknown '%c'", __func__, ictx->ch);
@@ -2268,6 +2272,10 @@ input_dcs_dispatch(struct input_ctx *ictx)
const char prefix[] = "tmux;";
const u_int prefixlen = (sizeof prefix) - 1;
long long allow_passthrough = 0;
+#ifdef ENABLE_SIXEL
+ struct window *w = wp->window;
+ struct sixel_image *si;
+#endif
if (wp == NULL)
return (0);
@@ -2275,7 +2283,13 @@ input_dcs_dispatch(struct input_ctx *ictx)
log_debug("%s: %zu bytes (discard)", __func__, len);
return (0);
}
- log_debug("%s: %zu bytes", __func__, len);
+#ifdef ENABLE_SIXEL
+ if (buf[0] == 'q') {
+ si = sixel_parse(buf, len, w->xpixel, w->ypixel);
+ if (si != NULL)
+ screen_write_sixelimage(sctx, si, ictx->cell.cell.bg);
+ }
+#endif
allow_passthrough = options_get_number(wp->options, "allow-passthrough");
if (!allow_passthrough)