aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-05-02 20:58:30 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-05-02 20:58:30 +0000
commitdb9b99e8ac2ec07d3468cd4cb038cd27f99bc738 (patch)
tree0d5a3a87a83330bee9cb95e0a5a77cf72e5e9a1b
parentosc: fix scaling of legacy formatted color specifiers (diff)
osc: fix 'OSC 12 ?' to return the cursor color, not the cursor text color
-rw-r--r--CHANGELOG.md2
-rw-r--r--osc.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1bffeb18..303fad2e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -64,6 +64,8 @@
* Memory leak in terminal reset.
* Translation of cursor coordinates on resize
* Scaling of legacy formatted color specifiers in OSC sequences.
+* `OSC 12 ?` to return the cursor color, not the cursor's text color.
+
### Security
diff --git a/osc.c b/osc.c
index 800385ab..1946f052 100644
--- a/osc.c
+++ b/osc.c
@@ -525,9 +525,9 @@ osc_dispatch(struct terminal *term)
/* Client queried for current value */
if (strlen(string) == 1 && string[0] == '?') {
- uint8_t r = (term->cursor_color.text >> 16) & 0xff;
- uint8_t g = (term->cursor_color.text >> 8) & 0xff;
- uint8_t b = (term->cursor_color.text >> 0) & 0xff;
+ uint8_t r = (term->cursor_color.cursor >> 16) & 0xff;
+ uint8_t g = (term->cursor_color.cursor >> 8) & 0xff;
+ uint8_t b = (term->cursor_color.cursor >> 0) & 0xff;
char reply[32];
snprintf(reply, sizeof(reply), "\033]12;rgb:%02x/%02x/%02x\033\\", r, g, b);