aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-05-02 20:58:50 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-05-02 21:00:21 +0000
commit9eda632c97b8bc623f4d0c4d93bfd9d58e361793 (patch)
tree4eca3d55db0bf408a313817124f7fc0f0dcb1562
parentosc: fix 'OSC 12 ?' to return the cursor color, not the cursor text color (diff)
osc: OSC 12: mimic xterm - a color value of 0 means use inverted fg/bg
-rw-r--r--CHANGELOG.md2
-rw-r--r--osc.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 303fad2e..c1920c89 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -65,6 +65,8 @@
* 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.
+* `OSC 12;#000000` to configure the cursor to use inverted
+ foreground/background colors.
### Security
diff --git a/osc.c b/osc.c
index 1946f052..e40ee6a3 100644
--- a/osc.c
+++ b/osc.c
@@ -541,7 +541,10 @@ osc_dispatch(struct terminal *term)
LOG_INFO("change cursor color to %06x", color);
- term->cursor_color.cursor = 1 << 31 | color;
+ if (color == 0)
+ term->cursor_color.cursor = 0; /* Invert fg/bg */
+ else
+ term->cursor_color.cursor = 1u << 31 | color;
render_refresh(term);
break;