diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2023-09-15 12:33:33 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2023-09-19 09:27:59 +0100 |
commit | 789a98982eac63a02bb06fbd07a010fc2eec0e92 (patch) | |
tree | b3c14549341e2c9dda07c0b3f2d53ea665e18cf1 /input.c | |
parent | b202a2f1b517a3de7141fc35fbd9e39ed5ac5284 (diff) |
Reply to SMGRAPHICS.
Diffstat (limited to 'input.c')
-rw-r--r-- | input.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -1839,8 +1839,22 @@ input_csi_dispatch_sm_private(struct input_ctx *ictx) /* Handle CSI graphics SM. */ static void -input_csi_dispatch_sm_graphics(__unused struct input_ctx *ictx) +input_csi_dispatch_sm_graphics(struct input_ctx *ictx) { +#ifdef ENABLE_SIXEL + int n, m, o; + + if (ictx->param_list_len > 3) + return; + n = input_get(ictx, 0, 0, 0); + m = input_get(ictx, 1, 0, 0); + o = input_get(ictx, 2, 0, 0); + + if (n == 1 && (m == 1 || m == 2 || m == 4)) + input_reply(ictx, "\033[?%d;0;%uS", n, SIXEL_COLOUR_REGISTERS); + else + input_reply(ictx, "\033[?%d;3;%dS", n, o); +#endif } /* Handle CSI window operations. */ |