diff src/term.c @ 20181:0ab9d7469ce7 v8.2.0646

patch 8.2.0646: t_Co uses the value of $COLORS in the GUI Commit: https://github.com/vim/vim/commit/759d81549c1340185f0d92524c563bb37697ea88 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Apr 26 16:52:49 2020 +0200 patch 8.2.0646: t_Co uses the value of $COLORS in the GUI Problem: t_Co uses the value of $COLORS in the GUI. (Masato Nishihata) Solution: Ignore $COLORS for the GUI. (closes https://github.com/vim/vim/issues/5992)
author Bram Moolenaar <Bram@vim.org>
date Sun, 26 Apr 2020 17:00:03 +0200
parents fcfad3f4bc66
children 426ef48be465
line wrap: on
line diff
--- a/src/term.c
+++ b/src/term.c
@@ -3122,15 +3122,21 @@ ttest(int pairs)
     }
     need_gather = TRUE;
 
-    // Set t_colors to the value of $COLORS or t_Co.
+    // Set t_colors to the value of $COLORS or t_Co.  Ignore $COLORS in the
+    // GUI.
     t_colors = atoi((char *)T_CCO);
-    env_colors = mch_getenv((char_u *)"COLORS");
-    if (env_colors != NULL && isdigit(*env_colors))
+#ifdef FEAT_GUI
+    if (!gui.in_use)
+#endif
     {
-	int colors = atoi((char *)env_colors);
-
-	if (colors != t_colors)
-	    set_color_count(colors);
+	env_colors = mch_getenv((char_u *)"COLORS");
+	if (env_colors != NULL && isdigit(*env_colors))
+	{
+	    int colors = atoi((char *)env_colors);
+
+	    if (colors != t_colors)
+		set_color_count(colors);
+	}
     }
 }