Skip to content

Commit

Permalink
Merge pull request #6012 from jamessan/override-TI-cursor-normal
Browse files Browse the repository at this point in the history
tui: Ignore DECRST 12 in terminfo's cursor_normal, if present
  • Loading branch information
jamessan committed Jan 26, 2017
2 parents 59fd0c4 + fd2d4c5 commit 5527754
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/nvim/tui/tui.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 5527754

Please sign in to comment.