From 5bdad50307806f2e4595fc0a60d504fa2eb7fff9 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Fri, 16 Jun 2017 15:57:19 +0100 Subject: doco: Document constant 'term' in more detail. Also expand the example in term-dependent-settings. --- runtime/doc/term.txt | 16 +++++++++++++--- runtime/doc/vim_diff.txt | 7 ++++++- 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index db0bc81d72..3ae63d3e21 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -90,12 +90,22 @@ Settings depending on terminal *term-dependent-settings* If you want to set options or mappings, depending on the terminal name, you can do this best in your init.vim. Example: > - if $TERM =~ '^\(rxvt\|screen\)\(\|-.*\)' + if $TERM =~ '^\(rxvt\|screen\|interix\|putty\)\(-.*\)\?$' set notermguicolors - elseif $TERM =~ '^\(xterm\|tmux\)\(\|-.*\)' + elseif $TERM =~ '^\(tmux\|iterm\|vte\|gnome\)\(-.*\)\?$' set termguicolors + elseif $TERM =~ '^\(xterm\)\(-.*\)\?$' + if $XTERM_VERSION != '' + set termguicolors + elseif $KONSOLE_PROFILE_NAME != '' + set termguicolors + elseif $VTE_VERSION != '' + set termguicolors + else + set notermguicolors + endif elseif $TERM =~ ... - ... and so forth ... + ... and so forth ... endif < *scroll-region* *xterm-scroll-region* diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index d906b874f0..5801da1132 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -292,6 +292,12 @@ Nvim does not have special `t_XX` options nor keycodes to configure terminal capabilities. Instead Nvim treats the terminal as any other UI. For example, 'guicursor' sets the terminal cursor style if possible. + *'term'* *E529* *E530* *E531* +The 'term' option has a fixed value, present only for script compatibility and +intentionally not the same as any known terminal type name. It should be a +rare case in Nvim where one needs |term-dependent-settings|, for which use the +|TERM| environment variable. + *termcap* Nvim never uses the termcap database and only uses |terminfo|. See |builtin-terms| for what happens on operating systems without a terminfo @@ -346,7 +352,6 @@ Other options: 'shelltype' *'shortname'* *'sn'* *'noshortname'* *'nosn'* *'swapsync'* *'sws'* - *'term'* *E529* *E530* *E531* *'termencoding'* *'tenc'* (Vim 7.4.852 also removed this for Windows) 'textauto' 'textmode' -- cgit From 68d2fb7570031cdd166722cbd7a50c41517004f2 Mon Sep 17 00:00:00 2001 From: Jonathan de Boyne Pollard Date: Sun, 9 Jul 2017 18:48:32 +0100 Subject: tui: Improve the setrgbf/setrgbb fallback logic. The libvte test was too agressive, and is reduced to only triggering when it is libvte 0.36 AND a gnome or xterm terminal type is used. Contrastingly, tmux was not on the list at all and now is. --- runtime/doc/term.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index 3ae63d3e21..bce944eab5 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -161,11 +161,12 @@ constructed "setrgbf" and "setrgbb" capabilities as if they had been in the terminfo definition. If your terminal's terminfo definition does not (yet) have this flag, Nvim -will fall back to looking at the TERM and other environment variables. For -the "rxvt", "linux", "st", and "iterm" terminal types, or when Konsole, -genuine Xterm, or a terminal emulator that sets the COLORTERM environment -variable to "truecolor" is detected, it will also add constructed "setrgbf" -and "setrgbb" capabilities. +will fall back to looking at the TERM and other environment variables. It +will add constructed "setrgbf" and "setrgbb" capabilities in the case of the +the "rxvt", "linux", "st", "tmux", and "iterm" terminal types, or when +Konsole, genuine Xterm, a libvte terminal emulator version 0.36 or later, or a +terminal emulator that sets the COLORTERM environment variable to "truecolor" +is detected. *xterm-resize* Nvim can resize the terminal display on some terminals that implement an -- cgit