patch 9.1.1054: Vim doesn't work well with TERM=xterm-direct
Problem: Vim doesn't work well with TERM=xterm-direct
(Andrea Pappacoda)
Solution: detect if a terminal supports true-colors and
enable termguicolors
The terminfo database for xterm-direct contains both the (non-standard)
termcap RGB capability and a number of colors == 0x1000000 so it seems
either of those two options can be used to detect a terminal capable of
displaying true colors.
So set the termguicolor option automatically, when either of the two
options is detected. (for some reasons, my debian xterm (v393) does not
respond to XTGETTCAP query attempts, so falling back to the number of
colors seems like a good compromize)
fixes: #16327
closes: #16490
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt
index f77499a..e2243f6 100644
--- a/runtime/doc/version9.txt
+++ b/runtime/doc/version9.txt
@@ -1,4 +1,4 @@
-*version9.txt* For Vim version 9.1. Last change: 2025 Jan 25
+*version9.txt* For Vim version 9.1. Last change: 2025 Jan 26
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -41628,6 +41628,8 @@
- New option value "nosort" for 'completeopt'
- add |dist#vim9#Launch()| and |dist#vim9#Open()| to the |vim-script-library|
and decouple it from |netrw|
+- 'termguicolors' is automatically enabled if the terminal supports the RGB
+ terminfo capability or supports 0x1000000 colors
*added-9.2*
Added ~