terminal: ConPTY does not support black background

bash repro: echo -e '\x1b[40mabc' powershell repro: Write-Host -BackgroundColor Black "Hello"

Expected (conhost/powershell.exe):

image

Actual (vscode/conpty):

image

image

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 14
  • Comments: 17 (8 by maintainers)

Commits related to this issue

Most upvoted comments

For people landing here after wondering why highlighted backgrounds are invisible with Solarized palettes, here a summary of what does not work currently.

reference Solarized colors reference colors

Windows Terminal (preview) rendering win term colors

(the script)

  • the column labeled 40m has an invisible background Probably the most striking difference when running typical apps in the terminal because all highlights are gone (vim, tmux, status bars, …). In the Solarized palette this color is base02, which corresponds to “black” (color 0). As already explained by @DHowett-MSFT, “black background” is always translated to the default background color, which for us is base03 a.k.a. “bright black” (color 8).

  • the row labeled 1m has white text This text should have the same base0 color for “foreground” (same as “bright blue” in the Solarized palette) as the row above, but making it bold automatically translates it to base3 for “bright white” (color 15), making it identical to the 1;37m row.

  • the row labeled 37m has gray text This text should have the base2 color for “white” (color 7), but it was translated to the base0 color for “foreground” instead, making it identical to the m row.

And on that note: thanks, everyone, for playing! This has been fixed and should be out in 1. the Terminal previews and 2. the next full-scale Windows update, so VSCode can take advantage of it.

@erossetto Not at this time, no. This bug is a pretty high priority for us, but actually requires a decent amount of work and unfortunately didn’t make the cut for 1.0. Hopefully this should land soon after 1.0. When we do have updates, we’ll make sure to update this thread.

Wouldn’t be possible to make this togglable/negotiable between client and conpty? I assume most of us are interested in this in WSL space and not in legacy cmd.exe.

That just changes your foreground and background colors, it doesn’t fix the underlying issue.