Monday, September 26, 2022

termguicolors in Windows Terminal outputs wrong color

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.ajmain@gmail.com
https://www.github.com/3N4N

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/9a17abe7-c925-495a-8725-b7f09183aec3n%40googlegroups.com.

No comments:

Post a Comment