diff options
author | James McCoy <jamessan@jamessan.com> | 2017-01-26 09:50:59 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-26 09:50:59 -0500 |
commit | 5527754f95df4a7e56aa4ad6db0b3b9ac9b07a9e (patch) | |
tree | 5eb53a14400f2e07e5df662a97366e622167126c | |
parent | 59fd0c4132f06a76c460f46ec93fce7b7f1d6f08 (diff) | |
parent | fd2d4c5ab93a2602cc19d0f48062ff37087dae30 (diff) | |
download | rneovim-5527754f95df4a7e56aa4ad6db0b3b9ac9b07a9e.tar.gz rneovim-5527754f95df4a7e56aa4ad6db0b3b9ac9b07a9e.tar.bz2 rneovim-5527754f95df4a7e56aa4ad6db0b3b9ac9b07a9e.zip |
Merge pull request #6012 from jamessan/override-TI-cursor-normal
tui: Ignore DECRST 12 in terminfo's cursor_normal, if present
-rw-r--r-- | src/nvim/tui/tui.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 342c68818d..ed82e23be2 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -844,7 +844,16 @@ static void fix_terminfo(TUIData *data) } if (STARTS_WITH(term, "xterm") || STARTS_WITH(term, "rxvt")) { - unibi_set_if_empty(ut, unibi_cursor_normal, "\x1b[?25h"); + const char *normal = unibi_get_str(ut, unibi_cursor_normal); + if (!normal) { + unibi_set_str(ut, unibi_cursor_normal, "\x1b[?25h"); + } else if (STARTS_WITH(normal, "\x1b[?12l")) { + // terminfo typically includes DECRST 12 as part of setting up the normal + // cursor, which interferes with the user's control via + // NVIM_TUI_ENABLE_CURSOR_SHAPE. When DECRST 12 is present, skip over + // it, but honor the rest of the TI setting. + unibi_set_str(ut, unibi_cursor_normal, normal + strlen("\x1b[?12l")); + } unibi_set_if_empty(ut, unibi_cursor_invisible, "\x1b[?25l"); unibi_set_if_empty(ut, unibi_flash_screen, "\x1b[?5h$<100/>\x1b[?5l"); unibi_set_if_empty(ut, unibi_exit_attribute_mode, "\x1b(B\x1b[m"); |