In terminal emulators, bash fails to render correct background color #108

Open
opened 2026-01-30 21:42:33 +00:00 by claunia · 0 comments
Owner

Originally created by @bitcrazed on GitHub (Feb 16, 2018).

From @Elderry on July 17, 2017 8:2

My Windows build number: Microsoft Windows [Version 10.0.15063]

It seems that in many terminal emulators, after running a command that outputs colors to the terminal using bash, the background will become a strange gray or black. But the default Windows Console doesn't has this problem. Here are the examples:

Integrated Terminal of Visual Studio Code:
1

Integrated Terminal of Intellij IDEA:
2

Default Windows Console:
3

To provide more detail, here is my bash prompt:

BLUE='\e[1;34m'
GREEN='\e[1;32m'
RESET='\e[0m'
source $HOME/Projects/Personal/posh-git-sh/git-prompt.sh
PROMPT_COMMAND='__posh_git_ps1 "" "${BLUE}\w\n${GREEN}\u@\h${RESET} > "'

Copied from original issue: Microsoft/WSL#2344

Originally created by @bitcrazed on GitHub (Feb 16, 2018). _From @Elderry on July 17, 2017 8:2_ My Windows build number: Microsoft Windows [Version 10.0.15063] It seems that in many terminal emulators, after running a command that outputs colors to the terminal using bash, the background will become a strange gray or black. But the default Windows Console doesn't has this problem. Here are the examples: Integrated Terminal of Visual Studio Code: <img width="614" alt="1" src="https://user-images.githubusercontent.com/1892221/28259432-d27e19b6-6b08-11e7-896a-871dd8f8327b.PNG"> Integrated Terminal of Intellij IDEA: <img width="653" alt="2" src="https://user-images.githubusercontent.com/1892221/28259448-e142b574-6b08-11e7-8b2e-9e8516e5b6fa.PNG"> Default Windows Console: <img width="732" alt="3" src="https://user-images.githubusercontent.com/1892221/28259457-ef355344-6b08-11e7-9d6e-842abc040733.PNG"> To provide more detail, here is my bash prompt: ``` BLUE='\e[1;34m' GREEN='\e[1;32m' RESET='\e[0m' source $HOME/Projects/Personal/posh-git-sh/git-prompt.sh PROMPT_COMMAND='__posh_git_ps1 "" "${BLUE}\w\n${GREEN}\u@\h${RESET} > "' ``` _Copied from original issue: Microsoft/WSL#2344_
claunia added the Resolution-Fix-Available label 2026-01-30 21:42:33 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#108