summaryrefslogtreecommitdiff
path: root/src/libvterm
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-08-12 19:51:41 +0200
committerBram Moolenaar <Bram@vim.org>2017-08-12 19:51:41 +0200
commit3cd43ccccb03b2e68df9c8a344a87e51c007c656 (patch)
tree51e41f2ba0520be2c6f4b0753538259545feca05 /src/libvterm
parent589b1109c55409baf27f79920d8ffc95111eaa01 (diff)
downloadvim-git-3cd43ccccb03b2e68df9c8a344a87e51c007c656.tar.gz
patch 8.0.0918: cannot get terminal window cursor shape or attributesv8.0.0918
Problem: Cannot get terminal window cursor shape or attributes. Solution: Support cursor shape, attributes and color.
Diffstat (limited to 'src/libvterm')
-rw-r--r--src/libvterm/include/vterm.h3
-rw-r--r--src/libvterm/src/state.c5
-rw-r--r--src/libvterm/src/vterm.c1
3 files changed, 8 insertions, 1 deletions
diff --git a/src/libvterm/include/vterm.h b/src/libvterm/include/vterm.h
index cd7b1f772..50a840a31 100644
--- a/src/libvterm/include/vterm.h
+++ b/src/libvterm/include/vterm.h
@@ -120,7 +120,8 @@ typedef enum {
VTERM_PROP_ICONNAME, /* string */
VTERM_PROP_REVERSE, /* bool */
VTERM_PROP_CURSORSHAPE, /* number */
- VTERM_PROP_MOUSE /* number */
+ VTERM_PROP_MOUSE, /* number */
+ VTERM_PROP_CURSORCOLOR /* string */
} VTermProp;
enum {
diff --git a/src/libvterm/src/state.c b/src/libvterm/src/state.c
index 8f8909e2f..88c259c34 100644
--- a/src/libvterm/src/state.c
+++ b/src/libvterm/src/state.c
@@ -1504,6 +1504,10 @@ static int on_osc(const char *command, size_t cmdlen, void *user)
settermprop_string(state, VTERM_PROP_TITLE, command + 2, cmdlen - 2);
return 1;
}
+ else if(strneq(command, "12;", 3)) {
+ settermprop_string(state, VTERM_PROP_CURSORCOLOR, command + 3, cmdlen - 3);
+ return 1;
+ }
else if(state->fallbacks && state->fallbacks->osc)
if((*state->fallbacks->osc)(command, cmdlen, state->fbdata))
return 1;
@@ -1819,6 +1823,7 @@ int vterm_state_set_termprop(VTermState *state, VTermProp prop, VTermValue *val)
switch(prop) {
case VTERM_PROP_TITLE:
case VTERM_PROP_ICONNAME:
+ case VTERM_PROP_CURSORCOLOR:
/* we don't store these, just transparently pass through */
return 1;
case VTERM_PROP_CURSORVISIBLE:
diff --git a/src/libvterm/src/vterm.c b/src/libvterm/src/vterm.c
index 2931e5202..b2a7240ff 100644
--- a/src/libvterm/src/vterm.c
+++ b/src/libvterm/src/vterm.c
@@ -294,6 +294,7 @@ VTermValueType vterm_get_prop_type(VTermProp prop)
case VTERM_PROP_REVERSE: return VTERM_VALUETYPE_BOOL;
case VTERM_PROP_CURSORSHAPE: return VTERM_VALUETYPE_INT;
case VTERM_PROP_MOUSE: return VTERM_VALUETYPE_INT;
+ case VTERM_PROP_CURSORCOLOR: return VTERM_VALUETYPE_STRING;
}
return 0; /* UNREACHABLE */
}