@Echo Off causes color command to not work properly #17562

Open
opened 2026-01-31 05:46:06 +00:00 by claunia · 0 comments
Owner

Originally created by @jredfox on GitHub (May 25, 2022).

Windows Terminal version

1.12.10982.0

Windows build number

10.0.19044.1706

Other Software

Command Prompt

Steps to reproduce

execute this script with wt cmd /k file.bat "3f" notice it breaks there is a black background around what is suppose to be a blue background.

@ECHO OFF
color %~1%
java -version
pause

remove the @ECHO OFF
run wt cmd /k file.bat "3f" and it's fixed.

reproduce error with a new example:

color 3f
echo 
echo hello world

Expected Behavior

the entire background to be blue with white text just like in conhost.exe. In the 2d example batch file the expected behavior was suppose to make it color 3f the last color set via the color command after the escape sequence but instead it goes back to being black.

Actual Behavior

only changes the background highlighted around the text.

Originally created by @jredfox on GitHub (May 25, 2022). ### Windows Terminal version 1.12.10982.0 ### Windows build number 10.0.19044.1706 ### Other Software Command Prompt ### Steps to reproduce execute this script with `wt cmd /k file.bat "3f"` notice it breaks there is a black background around what is suppose to be a blue background. ``` @ECHO OFF color %~1% java -version pause ``` remove the `@ECHO OFF` run `wt cmd /k file.bat "3f"` and it's fixed. reproduce error with a new example: ``` color 3f echo  echo hello world ``` ### Expected Behavior the entire background to be blue with white text just like in conhost.exe. In the 2d example batch file the expected behavior was suppose to make it color 3f the last color set via the color command after the escape sequence but instead it goes back to being black. ### Actual Behavior only changes the background highlighted around the text.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17562