To: vim_dev@googlegroups.com Subject: Patch 8.2.0646 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0646 Problem: t_Co uses the value of $COLORS in the GUI. (Masato Nishihata) Solution: Ignore $COLORS for the GUI. (closes #5992) Files: src/os_unix.c, src/term.c *** ../vim-8.2.0645/src/os_unix.c 2020-04-14 20:56:27.589970249 +0200 --- src/os_unix.c 2020-04-26 16:43:07.809282873 +0200 *************** *** 4160,4170 **** static char envbuf_Servername[60]; # endif # endif - long colors = - # ifdef FEAT_GUI - gui.in_use ? 256*256*256 : - # endif - t_colors; # ifdef HAVE_SETENV setenv("TERM", term, 1); --- 4163,4168 ---- *************** *** 4174,4180 **** setenv("LINES", (char *)envbuf, 1); sprintf((char *)envbuf, "%ld", columns); setenv("COLUMNS", (char *)envbuf, 1); ! sprintf((char *)envbuf, "%ld", colors); setenv("COLORS", (char *)envbuf, 1); # ifdef FEAT_TERMINAL if (is_terminal) --- 4172,4178 ---- setenv("LINES", (char *)envbuf, 1); sprintf((char *)envbuf, "%ld", columns); setenv("COLUMNS", (char *)envbuf, 1); ! sprintf((char *)envbuf, "%d", t_colors); setenv("COLORS", (char *)envbuf, 1); # ifdef FEAT_TERMINAL if (is_terminal) *** ../vim-8.2.0645/src/term.c 2020-04-17 16:40:27.994627345 +0200 --- src/term.c 2020-04-26 16:44:33.320838748 +0200 *************** *** 3122,3136 **** } need_gather = TRUE; ! // Set t_colors to the value of $COLORS or t_Co. t_colors = atoi((char *)T_CCO); ! 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); } } --- 3122,3142 ---- } need_gather = TRUE; ! // Set t_colors to the value of $COLORS or t_Co. Ignore $COLORS in the ! // GUI. t_colors = atoi((char *)T_CCO); ! #ifdef FEAT_GUI ! if (!gui.in_use) ! #endif { ! 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); ! } } } *** ../vim-8.2.0645/src/version.c 2020-04-26 16:05:58.574358031 +0200 --- src/version.c 2020-04-26 16:52:19.330875713 +0200 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 646, /**/ -- Computers are useless. They can only give you answers. -- Pablo Picasso /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///