diff options
author | nicm <nicm> | 2021-06-10 07:36:47 +0000 |
---|---|---|
committer | nicm <nicm> | 2021-06-10 07:36:47 +0000 |
commit | f9f97c8145e97b0295f0792a643286126fe2d3f8 (patch) | |
tree | 4697fc251c1e9129ac4dc42c42a4d0266ea0b48b /screen.c | |
parent | 84e22168a52f8fe0fa0ef0431d1752273f53e8bd (diff) | |
download | rtmux-f9f97c8145e97b0295f0792a643286126fe2d3f8.tar.gz rtmux-f9f97c8145e97b0295f0792a643286126fe2d3f8.tar.bz2 rtmux-f9f97c8145e97b0295f0792a643286126fe2d3f8.zip |
Change cursor style handling so tmux understands which sequences contain
blinking and sets the flag appropriately, means that it works whether
cnorm disables blinking or not. GitHub issue 2682.
Diffstat (limited to 'screen.c')
-rw-r--r-- | screen.c | 32 |
1 files changed, 29 insertions, 3 deletions
@@ -81,7 +81,7 @@ screen_init(struct screen *s, u_int sx, u_int sy, u_int hlimit) s->titles = NULL; s->path = NULL; - s->cstyle = 0; + s->cstyle = SCREEN_CURSOR_DEFAULT; s->ccolour = xstrdup(""); s->tabs = NULL; s->sel = NULL; @@ -156,9 +156,35 @@ screen_reset_tabs(struct screen *s) void screen_set_cursor_style(struct screen *s, u_int style) { - if (style <= 6) { - s->cstyle = style; + switch (style) + { + case 0: + s->cstyle = SCREEN_CURSOR_DEFAULT; + break; + case 1: + s->cstyle = SCREEN_CURSOR_BLOCK; + s->mode |= MODE_BLINKING; + break; + case 2: + s->cstyle = SCREEN_CURSOR_BLOCK; s->mode &= ~MODE_BLINKING; + break; + case 3: + s->cstyle = SCREEN_CURSOR_UNDERLINE; + s->mode |= MODE_BLINKING; + break; + case 4: + s->cstyle = SCREEN_CURSOR_UNDERLINE; + s->mode &= ~MODE_BLINKING; + break; + case 5: + s->cstyle = SCREEN_CURSOR_BAR; + s->mode |= MODE_BLINKING; + break; + case 6: + s->cstyle = SCREEN_CURSOR_BAR; + s->mode &= ~MODE_BLINKING; + break; } } |