termguicolors in Windows Terminal outputs wrong color

81 views
Skip to first unread message

Enan

unread,
Sep 26, 2022, 2:36:10 PM9/26/22
to vim_use
I'm running vim built from source (v9.0.0594) with MSys2/MinGW64 [1] on
Windows Terminal [2] with the following command.


    vimd --clean +"set ls=2 tgc"


In the old conhost terminal, the colors are output properly [3].

But in Windows Terminal (v1.16.2524.0), the colors with `:h
termguicolors` enabled is incorrect [4].

FYI: Neovim outputs the colors perfectly in both conhost and Windows
Terminal.

Vim `:version` is:

    VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Sep 26 2022 21:56:22)
    MS-Windows 64-bit console version
    Included patches: 1-594
    Compiled by ACER@DESKTOP-5F09VFS
    Huge version without GUI.  Features included (+) or not (-):
    +acl                +ex_extra           +multi_lang         -tag_any_white
    +arabic             +extra_search       -mzscheme           -tcl
    +autocmd            -farsi              -netbeans_intg      +termguicolors
    +autochdir          +file_in_path       +num64              +terminal
    +autoservername     +find_in_path       +packages           -termresponse
    -balloon_eval       +float              +path_extra         +textobjects
    +balloon_eval_term  +folding            -perl               +textprop
    -browse             -footer             +persistent_undo    -tgetent
    ++builtin_terms     +gettext/dyn        +popupwin           +timers
    +byte_offset        -hangul_input       -postscript         +title
    +channel            +iconv/dyn          +printer            -toolbar
    +cindent            +insert_expand      +profile            +user_commands
    +clientserver       +ipv6               -python             +vartabs
    +clipboard          +job                -python3            +vertsplit
    +cmdline_compl      +jumplist           +quickfix           +vim9script
    +cmdline_hist       +keymap             +reltime            +viminfo
    +cmdline_info       +lambda             +rightleft          +virtualedit
    +comments           +langmap            -ruby               +visual
    +conceal            +libcall            +scrollbind         +visualextra
    +cryptv             +linebreak          +signs              +vreplace
    +cscope             +lispindent         +smartindent        +vtp
    +cursorbind         +listcmds           -sodium             +wildignore
    +cursorshape        +localmap           +sound              +wildmenu
    +dialog_con         -lua                +spell              +windows
    +diff               +menu               +startuptime        +writebackup
    +digraphs           +mksession          +statusline         -xfontset
    -dnd                +modify_fname       -sun_workshop       -xim
    -ebcdic             +mouse              +syntax             -xpm_w32
    +emacs_tags         -mouseshape         +tag_binary         -xterm_save
    +eval               +multi_byte_ime/dyn -tag_old_static    
      system vimrc file: "$VIM\vimrc"
        user vimrc file: "$HOME\_vimrc"
    2nd user vimrc file: "$HOME\vimfiles\vimrc"
    3rd user vimrc file: "$VIM\_vimrc"
          user exrc file: "$HOME\_exrc"
      2nd user exrc file: "$VIM\_exrc"
          defaults file: "$VIMRUNTIME\defaults.vim"
    Compilation: gcc -I. -Iproto -DWIN32 -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -DHAVE_PATHDEF -DFEAT_HUGE -DHAVE_STDINT_H -DMS_WIN64 -DHAVE_GETTEXT -DHAVE_LOCALE_H -DDYNAMIC_GETTEXT -DFEAT_CSCOPE -DFEAT_JOB_CHANNEL -DFEAT_IPV6 -DHAVE_INET_NTOP -DFEAT_TERMINAL -DFEAT_SOUND -DFEAT_MBYTE_IME -DDYNAMIC_IME -DDYNAMIC_ICONV -pipe -march=x86-64 -Wall -g -fstack-check
    Linking: gcc -I. -Iproto -DWIN32 -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -DHAVE_PATHDEF -DFEAT_HUGE -DHAVE_STDINT_H -DMS_WIN64 -DHAVE_GETTEXT -DHAVE_LOCALE_H -DDYNAMIC_GETTEXT -DFEAT_CSCOPE -DFEAT_JOB_CHANNEL -DFEAT_IPV6 -DHAVE_INET_NTOP -DFEAT_TERMINAL -DFEAT_SOUND -DFEAT_MBYTE_IME -DDYNAMIC_IME -DDYNAMIC_ICONV -pipe -march=x86-64 -Wall -g -fstack-check -municode -o vimd.exe -lkernel32 -luser32 -lgdi32 -ladvapi32 -lcomdlg32 -lcomctl32 -lnetapi32 -lversion -lwsock32 -lws2_32 -lwinmm -lole32 -luuid      

P.S. I doubled-checked with 32-bit vim (instead of 64-bit). Same result.

P.P.S: I asked about this on the vi.SO site, too [5].


[1]: github.com/vim/vim/tree/master/src/INSTALLpc.txt#L233-L244
[2]: https://github.com/microsoft/terminal/
[3]: https://i.stack.imgur.com/fUNtg.png
[4]: https://i.stack.imgur.com/G6XAq.png
[5]: https://vi.stackexchange.com/q/38672/16280

--
Enan
3nan....@gmail.com
https://www.github.com/3N4N

Enan Ajmain

unread,
Sep 28, 2022, 3:31:26 AM9/28/22
to vim...@googlegroups.com
On Tue Sep 27, 2022 at 12:36 AM +06, Enan wrote:
>
> P.P.S: I asked about this on the vi.SO site, too [5].
>
>
> [1]: github.com/vim/vim/tree/master/src/INSTALLpc.txt#L233-L244
> [2]: https://github.com/microsoft/terminal/
> [3]: https://i.stack.imgur.com/fUNtg.png
> [4]: https://i.stack.imgur.com/G6XAq.png
> [5]: https://vi.stackexchange.com/q/38672/16280
>

I also opened a bug report on Windows Terminal:
https://github.com/microsoft/terminal/issues/14095

Enan Ajmain

unread,
Oct 9, 2022, 1:40:31 AM10/9/22
to vim...@googlegroups.com
It appears that this is not a problem specific only to Windows Terminal.
I'm also facing this problem in wezterm[1].

[1]: https://wezfurlong.org/wezterm/

--
Enan
Reply all
Reply to author
Forward
0 new messages