Skip to content

Commit 27822a0

Browse files
committed
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 <[email protected]>
1 parent 3f60114 commit 27822a0

4 files changed

Lines changed: 10 additions & 13 deletions

File tree

runtime/doc/options.txt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*options.txt* For Vim version 9.1. Last change: 2025 Feb 08
1+
*options.txt* For Vim version 9.1. Last change: 2025 Feb 16
22

33

44
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|.
85158515
When on, uses |highlight-guifg| and |highlight-guibg| attributes in
85168516
the terminal (thus using 24-bit color).
85178517

8518-
Will automatically be enabled, if Vim detects that it runs in a
8519-
capable terminal (when the terminal supports the RGB terminfo
8520-
capability or when the number of colors |t_Co| supported by the
8521-
terminal is 0x1000000, e.g. with $TERM=xterm-direct). Due to the async
8522-
nature of querying the terminal, enabling this automatically is
8523-
noticable. Use >
8524-
set notermguicolors
8525-
< to explicitly disable.
8526-
85278518
Requires a ISO-8613-3 compatible terminal. If setting this option
85288519
does not work (produces a colorless UI) reading |xterm-true-color|
85298520
might help.

runtime/doc/version9.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41583,8 +41583,6 @@ Adjusted default values ~
4158341583
increased to 12pt to accomodate modern high-dpi monitors
4158441584
- the default value of the 'keyprotocol' option has been updated and support
4158541585
for the ghostty terminal emulator (using kitty protocol) has been added
41586-
- 'termguicolors' is automatically enabled if the terminal supports the RGB
41587-
terminfo capability or supports 0x1000000 colors
4158841586

4158941587
*changed-9.2*
4159041588
Changed~

src/term.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1661,10 +1661,12 @@ set_color_count(int nr)
16611661
sprintf((char *)nr_colors, "%d", t_colors);
16621662
else
16631663
*nr_colors = NUL;
1664+
#if 0
16641665
#ifdef FEAT_TERMGUICOLORS
16651666
// xterm-direct, enable termguicolors, when it wasn't set yet
16661667
if (t_colors == 0x1000000 && !p_tgc_set)
16671668
set_option_value((char_u *)"termguicolors", 1L, NULL, 0);
1669+
#endif
16681670
#endif
16691671
set_string_option_direct((char_u *)"t_Co", -1, nr_colors, OPT_FREE, 0);
16701672
}
@@ -1701,7 +1703,9 @@ static char *(key_names[]) =
17011703
# ifdef FEAT_TERMRESPONSE
17021704
// Do those ones first, both may cause a screen redraw.
17031705
"Co",
1704-
"RGB",
1706+
// disabled, because it switches termguicolors, but that
1707+
// is noticable and confuses users
1708+
// "RGB",
17051709
# endif
17061710
"ku", "kd", "kr", "kl",
17071711
"#2", "#4", "%i", "*7",
@@ -7197,6 +7201,7 @@ got_code_from_term(char_u *code, int len)
71977201
#endif
71987202
may_adjust_color_count(val);
71997203
}
7204+
#if 0
72007205
#ifdef FEAT_TERMGUICOLORS
72017206
// when RGB result comes back, it is supported when the result contains an '='
72027207
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)
72137218
set_option_value((char_u *)"termguicolors", 1L, NULL, 0);
72147219
}
72157220
}
7221+
#endif
72167222
#endif
72177223
else
72187224
{

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
1114,
707709
/**/
708710
1113,
709711
/**/

0 commit comments

Comments
 (0)