aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-01-01 19:38:18 +0100
committerJustin M. Keyes <justinkz@gmail.com>2018-01-01 20:30:30 +0100
commit60716371e97dae916c6525e9ba840aae562069bb (patch)
tree56343a8deb75e3cd9c8cb815c41d140b0813a50b /src
parent95a8af093fdd543f8617f7fee27740eedd7c811a (diff)
downloadrneovim-60716371e97dae916c6525e9ba840aae562069bb.tar.gz
rneovim-60716371e97dae916c6525e9ba840aae562069bb.tar.bz2
rneovim-60716371e97dae916c6525e9ba840aae562069bb.zip
tui: support TERM=konsole-256color
TERM=konsole-256color is recognized by ncurses. TERM=konsole-xterm might be more clever, but should not be necessary (for Nvim at least), we already special-case Konsole in various places. We may need to clean up some areas that currently assume Konsole always "pretends xterm" (`TERM=xterm-256color`), though I didn't find any such cases. ref #6403 ref https://github.com/neovim/neovim/issues/6403#issuecomment-348713346
Diffstat (limited to 'src')
-rw-r--r--src/nvim/tui/terminfo.c4
-rw-r--r--src/nvim/tui/tui.c3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/tui/terminfo.c b/src/nvim/tui/terminfo.c
index 492c1c5e9c..2f07e83158 100644
--- a/src/nvim/tui/terminfo.c
+++ b/src/nvim/tui/terminfo.c
@@ -90,8 +90,8 @@ bool terminfo_is_term_family(const char *term, const char *family)
size_t tlen = strlen(term);
size_t flen = strlen(family);
return tlen >= flen
- && 0 == memcmp(term, family, flen) \
- // Per the commentary in terminfo, minus sign is the suffix separator.
+ && 0 == memcmp(term, family, flen)
+ // Per commentary in terminfo, minus is the only valid suffix separator.
&& ('\0' == term[flen] || '-' == term[flen]);
}
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
index dbe1222dc0..df5b41a64b 100644
--- a/src/nvim/tui/tui.c
+++ b/src/nvim/tui/tui.c
@@ -222,7 +222,8 @@ static void terminfo_start(UI *ui)
const char *vte_version_env = os_getenv("VTE_VERSION");
long vte_version = vte_version_env ? strtol(vte_version_env, NULL, 10) : 0;
bool iterm_env = termprg && strstr(termprg, "iTerm.app");
- bool konsole = os_getenv("KONSOLE_PROFILE_NAME")
+ bool konsole = terminfo_is_term_family(term, "konsole")
+ || os_getenv("KONSOLE_PROFILE_NAME")
|| os_getenv("KONSOLE_DBUS_SESSION");
patch_terminfo_bugs(data, term, colorterm, vte_version, konsole, iterm_env);