aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkDefender <darkdefende@gmail.com>2017-07-16 12:20:06 +0200
committerJustin M. Keyes <justinkz@gmail.com>2017-07-30 22:17:31 +0200
commitcb13ef3596ee9d952a2d12c78d9036b7fd134c89 (patch)
tree7b31c878425ce32cc2e648c6fb8be9acf70dfffa
parent5cd68b39003dc51c5b80147d689cf7e8b67443b0 (diff)
downloadrneovim-cb13ef3596ee9d952a2d12c78d9036b7fd134c89.tar.gz
rneovim-cb13ef3596ee9d952a2d12c78d9036b7fd134c89.tar.bz2
rneovim-cb13ef3596ee9d952a2d12c78d9036b7fd134c89.zip
tui: fix truecolor in libvte, tmux #7037
Closes #7041
-rw-r--r--src/nvim/tui/tui.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
index 0975b87ea3..c29ec09638 100644
--- a/src/nvim/tui/tui.c
+++ b/src/nvim/tui/tui.c
@@ -1537,11 +1537,11 @@ static void augment_terminfo(TUIData *data, const char *term,
bool teraterm = terminfo_is_term_family(term, "teraterm");
bool putty = terminfo_is_term_family(term, "putty");
bool screen = terminfo_is_term_family(term, "screen");
+ bool tmux = terminfo_is_term_family(term, "tmux") || !!os_getenv("TMUX");
bool iterm = terminfo_is_term_family(term, "iterm")
|| terminfo_is_term_family(term, "iTerm.app");
// None of the following work over SSH; see :help TERM .
bool iterm_pretending_xterm = xterm && iterm_env;
- bool tmux_wrap = screen && !!os_getenv("TMUX");
const char * xterm_version = os_getenv("XTERM_VERSION");
bool true_xterm = xterm && !!xterm_version;
@@ -1573,12 +1573,11 @@ static void augment_terminfo(TUIData *data, const char *term,
// specific ones.
// can use colons like ISO 8613-6:1994/ITU T.416:1993 says.
- bool has_colon_rgb = false
- // per GNOME bug #685759 and bug #704449
- || (vte_version >= 3600)
- || iterm || iterm_pretending_xterm // per analysis of VT100Terminal.m
- // per http://invisible-island.net/xterm/xterm.log.html#xterm_282
- || true_xterm;
+ bool has_colon_rgb = !tmux && !screen
+ && ((vte_version >= 3600) // per GNOME bug #685759, #704449
+ || iterm || iterm_pretending_xterm // per analysis of VT100Terminal.m
+ // per http://invisible-island.net/xterm/xterm.log.html#xterm_282
+ || true_xterm);
data->unibi_ext.set_rgb_foreground = unibi_find_ext_str(ut, "setrgbf");
if (-1 == data->unibi_ext.set_rgb_foreground) {
@@ -1606,7 +1605,7 @@ static void augment_terminfo(TUIData *data, const char *term,
// all panes, which is not particularly desirable. A better approach
// would use a tmux control sequence and an extra if(screen) test.
data->unibi_ext.set_cursor_color = (int)unibi_add_ext_str(
- ut, NULL, TMUX_WRAP(tmux_wrap, "\033]Pl%p1%06x\033\\"));
+ ut, NULL, TMUX_WRAP(tmux, "\033]Pl%p1%06x\033\\"));
} else if (xterm || (vte_version != 0) || rxvt) {
// This seems to be supported for a long time in VTE
// urxvt also supports this