patch 9.1.1114: enabling termguicolors automatically confuses users Commit: https://github.com/vim/vim/commit/27822a0441118133d08d6f1946d3a1598b2c15bd Author: Christian Brabandt <c...@256bit.org> Date: Sun Feb 16 09:30:00 2025 +0100
patch 9.1.1114: enabling termguicolors automatically confuses users Problem: enabling termguicolors automatically confuses users. Since querying the terminal for the RGB flag happens asynchronously, enabling termguicolors is noticeable by users as the highlighting changes and is therefore unexpected. (after v9.1.1054) Solution: comment out that part for now. We may need another way to enable this in the future. fixes: #16539 fixes: #16568 fixes: #16649 Signed-off-by: Christian Brabandt <c...@256bit.org> diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 94fb73995..1a72e650c 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 9.1. Last change: 2025 Feb 08 +*options.txt* For Vim version 9.1. Last change: 2025 Feb 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -8515,15 +8515,6 @@ A jump table for the options with a short description can be found at |Q_op|. When on, uses |highlight-guifg| and |highlight-guibg| attributes in the terminal (thus using 24-bit color). - Will automatically be enabled, if Vim detects that it runs in a - capable terminal (when the terminal supports the RGB terminfo - capability or when the number of colors |t_Co| supported by the - terminal is 0x1000000, e.g. with $TERM=xterm-direct). Due to the async - nature of querying the terminal, enabling this automatically is - noticable. Use > - set notermguicolors -< to explicitly disable. - Requires a ISO-8613-3 compatible terminal. If setting this option does not work (produces a colorless UI) reading |xterm-true-color| might help. diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt index fbe9b9865..de38d08e2 100644 --- a/runtime/doc/version9.txt +++ b/runtime/doc/version9.txt @@ -41583,8 +41583,6 @@ Adjusted default values ~ increased to 12pt to accomodate modern high-dpi monitors - the default value of the 'keyprotocol' option has been updated and support for the ghostty terminal emulator (using kitty protocol) has been added -- 'termguicolors' is automatically enabled if the terminal supports the RGB - terminfo capability or supports 0x1000000 colors *changed-9.2* Changed~ diff --git a/src/term.c b/src/term.c index 318b982d7..ea4c22d8b 100644 --- a/src/term.c +++ b/src/term.c @@ -1661,10 +1661,12 @@ set_color_count(int nr) sprintf((char *)nr_colors, "%d", t_colors); else *nr_colors = NUL; +#if 0 #ifdef FEAT_TERMGUICOLORS // xterm-direct, enable termguicolors, when it wasn't set yet if (t_colors == 0x1000000 && !p_tgc_set) set_option_value((char_u *)"termguicolors", 1L, NULL, 0); +#endif #endif set_string_option_direct((char_u *)"t_Co", -1, nr_colors, OPT_FREE, 0); } @@ -1701,7 +1703,9 @@ static char *(key_names[]) = # ifdef FEAT_TERMRESPONSE // Do those ones first, both may cause a screen redraw. "Co", - "RGB", + // disabled, because it switches termguicolors, but that + // is noticable and confuses users + // "RGB", # endif "ku", "kd", "kr", "kl", "#2", "#4", "%i", "*7", @@ -7197,6 +7201,7 @@ got_code_from_term(char_u *code, int len) #endif may_adjust_color_count(val); } +#if 0 #ifdef FEAT_TERMGUICOLORS // when RGB result comes back, it is supported when the result contains an '=' else if (name[0] == 'R' && name[1] == 'G' && name[2] == 'B' && code[9] == '=') @@ -7213,6 +7218,7 @@ got_code_from_term(char_u *code, int len) set_option_value((char_u *)"termguicolors", 1L, NULL, 0); } } +#endif #endif else { diff --git a/src/version.c b/src/version.c index 5fe62548f..deff16333 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1114, /**/ 1113, /**/ -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1tjaGz-00BuoF-Fi%40256bit.org.