Skip to content

Vim in MS Terminal mistakes color of ctermfg=7 #15408

Open
@3N4N

Description

@3N4N

Windows Terminal version

1.18.1241.0

Windows build number

10.0.22621.1702

Other Software

Vim 9.0.1472

Steps to reproduce

I have the following colorscheme in MS Terminal:

        {
            "background": "#FAFAFA",
            "black": "#383A42",
            "blue": "#0184BC",
            "brightBlack": "#4F525D",
            "brightBlue": "#61AFEF",
            "brightCyan": "#56B5C1",
            "brightGreen": "#98C379",
            "brightPurple": "#C577DD",
            "brightRed": "#DF6C75",
            "brightWhite": "#FAFAFA",
            "brightYellow": "#E4C07A",
            "cursorColor": "#383A42",
            "cyan": "#0997B3",
            "foreground": "#383A42",
            "green": "#50A14F",
            "name": "Yellowish",
            "purple": "#A626A4",
            "red": "#E45649",
            "selectionBackground": "#61AFEF",
            "white": "#FCF4DC",
            "yellow": "#C18301"
        }

With this colorscheme activated, run vim as follows.

vim --clean -c 'se ls=2 | hi StatusLine cterm=none ctermbg=8 ctermfg=7'

You'll see a statusline with black blacground, which is expected with ctermbg=8, and brightBlack foreground, whereas you should expect a white foreground with ctermfg=7.

Expected Behavior

With help of colortool, I modified Console Host to have the same colorscheme as MS Terminal. Here is the .ini scheme for easy reproduction:

[info]
name = Custom
author = enan

[table]
DARK_BLACK     = 56,58,66
DARK_BLUE      = 1,132,188
DARK_GREEN     = 80,161,79
DARK_CYAN      = 9,151,179
DARK_RED       = 228,86,73
DARK_MAGENTA   = 166,38,164
DARK_YELLOW    = 193,131,1
DARK_WHITE     = 252,244,220
BRIGHT_BLACK   = 79,82,93
BRIGHT_BLUE    = 97,175,239
BRIGHT_GREEN   = 152,195,121
BRIGHT_CYAN    = 86,181,193
BRIGHT_RED     = 223,108,117
BRIGHT_MAGENTA = 197,119,221
BRIGHT_YELLOW  = 228,192,122
BRIGHT_WHITE   = 250,250,250

[screen]
FOREGROUND = DARK_BLACK
BACKGROUND = BRIGHT_WHITE

[popup]
FOREGROUND = DARK_MAGENTA
BACKGROUND = DARK_WHITE

If you run the same command to start Vim, you'll now see a statusline with white foreground, which is what's expected from ctermfg=7.
expected

Actual Behavior

In MS Terminal, ctermfg=7 does NOT use the white color defined in the color table/scheme.

actual

In Console Host, ctermfg=7 DOES use the white color defined in the color table/scheme.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-ServerDown in the muck of API call servicing, interprocess communication, eventing, etc.Issue-DocsIt's a documentation issue that really should be on MicrosoftDocs/Console-DocsIssue-TaskIt's a feature request, but it doesn't really need a major design.Product-ConptyFor console issues specifically related to conpty

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions