aboutsummaryrefslogtreecommitdiff
path: root/csi.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-02-22 13:02:00 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-02-22 13:02:00 +0000
commit8e37a18083e8cdba1cfd4ee042d8f8edf7cfad39 (patch)
tree545c9aea0fdba18420c70ff33967a071b4cf4d16 /csi.c
parentsixel: use terminal's background color, not palette[0] (diff)
sixel: application configurable palette size (color count)
This implements the CSI escapes for retrieving and (re)setting the palette size.
Diffstat (limited to 'csi.c')
-rw-r--r--csi.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/csi.c b/csi.c
index ed237592..d5c06905 100644
--- a/csi.c
+++ b/csi.c
@@ -15,6 +15,7 @@
#include "grid.h"
#include "vt.h"
#include "selection.h"
+#include "sixel.h"
#define min(x, y) ((x) < (y) ? (x) : (y))
@@ -1227,6 +1228,30 @@ csi_dispatch(struct terminal *term, uint8_t final)
}
break;
+ case 'S': {
+ unsigned target = vt_param_get(term, 0, 0);
+ unsigned operation = vt_param_get(term, 1, 0);
+
+ switch (target) {
+ case 1:
+ switch (operation) {
+ case 1: sixel_colors_report_current(term); break;
+ case 2: sixel_colors_reset(term); break;
+ case 3: sixel_colors_set(term, vt_param_get(term, 2, 0)); break;
+ case 4: sixel_colors_report_max(term);
+ }
+ break;
+
+ case 2:
+ break;
+
+ case 3:
+ break;
+
+ }
+ break;
+ }
+
default:
UNHANDLED();
break;