mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 13:38:34 +00:00
TUI: assume italics support in all xterm-likes
https://github.com/neovim/neovim/issues/9598#issuecomment-462421302 > On systems other than macOS, terminfo always has them set. It's part > of the ANSI standard SGR codes
This commit is contained in:
@@ -1517,7 +1517,6 @@ static void patch_terminfo_bugs(TUIData *data, const char *term,
|
|||||||
bool alacritty = terminfo_is_term_family(term, "alacritty");
|
bool alacritty = terminfo_is_term_family(term, "alacritty");
|
||||||
// None of the following work over SSH; see :help TERM .
|
// None of the following work over SSH; see :help TERM .
|
||||||
bool iterm_pretending_xterm = xterm && iterm_env;
|
bool iterm_pretending_xterm = xterm && iterm_env;
|
||||||
bool konsole_pretending_xterm = xterm && konsolev;
|
|
||||||
bool gnome_pretending_xterm = xterm && colorterm
|
bool gnome_pretending_xterm = xterm && colorterm
|
||||||
&& strstr(colorterm, "gnome-terminal");
|
&& strstr(colorterm, "gnome-terminal");
|
||||||
bool mate_pretending_xterm = xterm && colorterm
|
bool mate_pretending_xterm = xterm && colorterm
|
||||||
@@ -1571,11 +1570,12 @@ static void patch_terminfo_bugs(TUIData *data, const char *term,
|
|||||||
// claim to be xterm. Or they would mimic xterm properly enough to be
|
// claim to be xterm. Or they would mimic xterm properly enough to be
|
||||||
// treatable as xterm.
|
// treatable as xterm.
|
||||||
|
|
||||||
// 2017-04 terminfo.src lacks these. genuine Xterm has them, as have
|
// 2017-04 terminfo.src lacks these. Xterm-likes have them.
|
||||||
// the false claimants.
|
|
||||||
unibi_set_if_empty(ut, unibi_to_status_line, "\x1b]0;");
|
unibi_set_if_empty(ut, unibi_to_status_line, "\x1b]0;");
|
||||||
unibi_set_if_empty(ut, unibi_from_status_line, "\x07");
|
unibi_set_if_empty(ut, unibi_from_status_line, "\x07");
|
||||||
unibi_set_if_empty(ut, unibi_set_tb_margin, "\x1b[%i%p1%d;%p2%dr");
|
unibi_set_if_empty(ut, unibi_set_tb_margin, "\x1b[%i%p1%d;%p2%dr");
|
||||||
|
unibi_set_if_empty(ut, unibi_enter_italics_mode, "\x1b[3m");
|
||||||
|
unibi_set_if_empty(ut, unibi_exit_italics_mode, "\x1b[23m");
|
||||||
|
|
||||||
if (true_xterm) {
|
if (true_xterm) {
|
||||||
// 2017-04 terminfo.src lacks these. genuine Xterm has them.
|
// 2017-04 terminfo.src lacks these. genuine Xterm has them.
|
||||||
@@ -1583,15 +1583,6 @@ static void patch_terminfo_bugs(TUIData *data, const char *term,
|
|||||||
unibi_set_if_empty(ut, unibi_set_left_margin_parm, "\x1b[%i%p1%ds");
|
unibi_set_if_empty(ut, unibi_set_left_margin_parm, "\x1b[%i%p1%ds");
|
||||||
unibi_set_if_empty(ut, unibi_set_right_margin_parm, "\x1b[%i;%p2%ds");
|
unibi_set_if_empty(ut, unibi_set_right_margin_parm, "\x1b[%i;%p2%ds");
|
||||||
}
|
}
|
||||||
if (true_xterm
|
|
||||||
|| iterm_pretending_xterm
|
|
||||||
|| gnome_pretending_xterm
|
|
||||||
|| konsole_pretending_xterm
|
|
||||||
|| nsterm) {
|
|
||||||
// Apple's outdated copy of terminfo.src for MacOS lacks these.
|
|
||||||
unibi_set_if_empty(ut, unibi_enter_italics_mode, "\x1b[3m");
|
|
||||||
unibi_set_if_empty(ut, unibi_exit_italics_mode, "\x1b[23m");
|
|
||||||
}
|
|
||||||
} else if (rxvt) {
|
} else if (rxvt) {
|
||||||
// 2017-04 terminfo.src lacks these. Unicode rxvt has them.
|
// 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_enter_italics_mode, "\x1b[3m");
|
||||||
|
Reference in New Issue
Block a user