From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Thu, 4 Nov 2021 22:04:17 +0000 Subject: [PATCH] patch_terminfo_bugs: Extend smglr ignores to smglp and smgrp The latter were added for xterm by ncurses 6.3 and are similarly affected. Fixes https://github.com/neovim/neovim/issues/16238 --- src/nvim/tui/tui.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index f9c5521bdb63..bb752863692d 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1663,30 +1663,46 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, const char *col ILOG("Disabling smglr with TERM=xterm for non-xterm."); unibi_set_str(ut, unibi_set_lr_margin, NULL); } + if (unibi_get_str(ut, unibi_set_left_margin_parm)) { + ILOG("Disabling smglp with TERM=xterm for non-xterm."); + unibi_set_str(ut, unibi_set_left_margin_parm, NULL); + } + if (unibi_get_str(ut, unibi_set_right_margin_parm)) { + ILOG("Disabling smgrp with TERM=xterm for non-xterm."); + unibi_set_str(ut, unibi_set_right_margin_parm, NULL); + } } #ifdef WIN32 // XXX: workaround libuv implicit LF => CRLF conversion. #10558 unibi_set_str(ut, unibi_cursor_down, "\x1b[B"); #endif } else if (rxvt) { // 2017-04 terminfo.src lacks these. Unicode rxvt has them. unibi_set_if_empty(ut, unibi_enter_italics_mode, "\x1b[3m"); unibi_set_if_empty(ut, unibi_exit_italics_mode, "\x1b[23m"); unibi_set_if_empty(ut, unibi_to_status_line, "\x1b]2"); unibi_set_if_empty(ut, unibi_from_status_line, "\x07"); // 2017-04 terminfo.src has older control sequences. unibi_set_str(ut, unibi_enter_ca_mode, "\x1b[?1049h"); unibi_set_str(ut, unibi_exit_ca_mode, "\x1b[?1049l"); } else if (screen) { // per the screen manual; 2017-04 terminfo.src lacks these. unibi_set_if_empty(ut, unibi_to_status_line, "\x1b_"); unibi_set_if_empty(ut, unibi_from_status_line, "\x1b\\"); // Fix an issue where smglr is inherited by TERM=screen.xterm. if (unibi_get_str(ut, unibi_set_lr_margin)) { ILOG("Disabling smglr with TERM=screen.xterm for screen."); unibi_set_str(ut, unibi_set_lr_margin, NULL); } + if (unibi_get_str(ut, unibi_set_left_margin_parm)) { + ILOG("Disabling smglp with TERM=screen.xterm for screen."); + unibi_set_str(ut, unibi_set_left_margin_parm, NULL); + } + if (unibi_get_str(ut, unibi_set_right_margin_parm)) { + ILOG("Disabling smgrp with TERM=screen.xterm for screen."); + unibi_set_str(ut, unibi_set_right_margin_parm, NULL); + } } else if (tmux) { unibi_set_if_empty(ut, unibi_to_status_line, "\x1b_"); unibi_set_if_empty(ut, unibi_from_status_line, "\x1b\\");