diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-08-12 19:51:41 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-08-12 19:51:41 +0200 |
commit | 3cd43ccccb03b2e68df9c8a344a87e51c007c656 (patch) | |
tree | 51e41f2ba0520be2c6f4b0753538259545feca05 /src/libvterm | |
parent | 589b1109c55409baf27f79920d8ffc95111eaa01 (diff) | |
download | vim-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.h | 3 | ||||
-rw-r--r-- | src/libvterm/src/state.c | 5 | ||||
-rw-r--r-- | src/libvterm/src/vterm.c | 1 |
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 */ } |