diff options
-rw-r--r-- | runtime/doc/term.txt | 4 | ||||
-rw-r--r-- | src/nvim/tui/terminfo.c | 4 | ||||
-rw-r--r-- | src/nvim/tui/tui.c | 3 |
3 files changed, 6 insertions, 5 deletions
diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index a694185fc9..6cf62f9bb5 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -38,13 +38,13 @@ Otherwise Nvim cannot know what sequences your terminal expects, and weird or sub-optimal behavior will result (scrolling quirks, wrong colors, etc.). $TERM is also important because it is mirrored by SSH to the remote session, -unlike other common client-end environment variables ($COLORTERM, -$XTERM_VERSION, $VTE_VERSION, $KONSOLE_PROFILE_NAME, $TERM_PROGRAM, ...). +unlike most other environment variables. For this terminal Set $TERM to |builtin-terms| ------------------------------------------------------------------------- iTerm (original) iterm, iTerm.app N iTerm2 (new capabilities) iterm2, iTerm2.app Y + Konsole konsole-256color N anything libvte-based vte, vte-256color Y (e.g. GNOME Terminal) (aliases: gnome, gnome-256color) tmux tmux, tmux-256color Y 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); |