diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2021-04-28 09:15:11 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2021-04-28 09:17:13 +0100 |
commit | 589d3eb48fcb30163c9ac3f4b8d5e802e3f45118 (patch) | |
tree | 1776b7f0d89f42db17f07decd1a201aefa5be9a1 /screen.c | |
parent | cf6034da92df1dec0a2ea6230bd7a424d0d181a8 (diff) | |
download | rtmux-589d3eb48fcb30163c9ac3f4b8d5e802e3f45118.tar.gz rtmux-589d3eb48fcb30163c9ac3f4b8d5e802e3f45118.tar.bz2 rtmux-589d3eb48fcb30163c9ac3f4b8d5e802e3f45118.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
@@ -80,7 +80,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; @@ -155,9 +155,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; } } |