Wild behavior from ANSI esq in batch variables #17664

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

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

Windows Terminal version

1.12.10982.0

Windows build number

10.0.19044.1706

Other Software

java

Steps to reproduce

wt new-tab --focus --title "Test App 1.0.0" -d "C:\Users\jredfox\Documents\dev\OpenTerminal" -p "Command Prompt" cmd /c call "C:\Users\jredfox\AppData\Roaming\OpenTerminal\scripts\boot\boot.bat" "" "Test App 1.0.0" ",C:\Program Files\Java\jre1.8.0_333/bin/java, -Dot.l -cp ,C:\Users\jredfox\Documents\dev\OpenTerminal\bin, jml.ot.OTMain" "true"

the batch file

@ECHO OFF
IF NOT "%~1%" == "" (
   echo "%~1%"
   cls ::hotfix for Windows Terminal
)
title %~2%
set boot=%~3
set boot=%boot:,=^"% ::RE-MAP the boot command to double quotes
call %boot%
IF "%~4%" == "true" (
set /p DUMMY=Press ENTER to continue...
)
exit 0 ::Work around from a command prompt bug

It opens up like 20 tabs instead of one. with the ansi escape sequence in the batch variable string.

Expected Behavior

it opens up the my java program in wt with the colored output.

Actual Behavior

instead it opens up 20 tabs. it's having some wild behavior. switching to conhost.exe and cmd fixes the issue. I am going to work around this by changing the ansi escape to another character but this is just very silly

Originally created by @jredfox on GitHub (Jun 9, 2022). ### Windows Terminal version 1.12.10982.0 ### Windows build number 10.0.19044.1706 ### Other Software java ### Steps to reproduce `wt new-tab --focus --title "Test App 1.0.0" -d "C:\Users\jredfox\Documents\dev\OpenTerminal" -p "Command Prompt" cmd /c call "C:\Users\jredfox\AppData\Roaming\OpenTerminal\scripts\boot\boot.bat" "" "Test App 1.0.0" ",C:\Program Files\Java\jre1.8.0_333/bin/java, -Dot.l -cp ,C:\Users\jredfox\Documents\dev\OpenTerminal\bin, jml.ot.OTMain" "true"` the batch file ```batch @ECHO OFF IF NOT "%~1%" == "" ( echo "%~1%" cls ::hotfix for Windows Terminal ) title %~2% set boot=%~3 set boot=%boot:,=^"% ::RE-MAP the boot command to double quotes call %boot% IF "%~4%" == "true" ( set /p DUMMY=Press ENTER to continue... ) exit 0 ::Work around from a command prompt bug ``` It opens up like 20 tabs instead of one. with the ansi escape sequence in the batch variable string. ### Expected Behavior it opens up the my java program in wt with the colored output. ### Actual Behavior instead it opens up 20 tabs. it's having some wild behavior. switching to conhost.exe and cmd fixes the issue. I am going to work around this by changing the ansi escape to another character but this is just very silly
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17664