ANSI ESC 39 and 49 seems to misbehave #17705

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

Originally created by @jredfox on GitHub (Jun 14, 2022).

Windows Terminal version

1.13.11431.0

Windows build number

10.0.19044 N/A Build 19044

Other Software

No response

Steps to reproduce

create a batch file

@Echo off
echo 
cls
pause
echo Hello world
cls
pause

run this in windows terminal using the command prompt profile

Expected Behavior

the background stays BLUE because 0m resets shouldn't reset the default BG and FG values. ANSI ESC 39 and 49 are to set the default bg and fg which should stay after 0m which is needed to clear alot of other ANSI escape codes
https://en.wikipedia.org/wiki/ANSI_escape_code

Actual Behavior

it goes purple then black. instead of staying the color it was previously

Originally created by @jredfox on GitHub (Jun 14, 2022). ### Windows Terminal version 1.13.11431.0 ### Windows build number 10.0.19044 N/A Build 19044 ### Other Software _No response_ ### Steps to reproduce create a batch file ```bat @Echo off echo  cls pause echo Hello world cls pause ``` run this in windows terminal using the command prompt profile ### Expected Behavior the background stays BLUE because 0m resets shouldn't reset the default BG and FG values. ANSI ESC 39 and 49 are to set the default bg and fg which should stay after 0m which is needed to clear alot of other ANSI escape codes https://en.wikipedia.org/wiki/ANSI_escape_code ### Actual Behavior it goes purple then black. instead of staying the color it was previously
claunia added the Needs-TriageIssue-BugNeeds-Tag-FixNeeds-Attention labels 2026-01-31 05:50:56 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17705