Ignores IF statements in batch #20013

Open
opened 2026-01-31 07:00:42 +00:00 by claunia · 0 comments
Owner

Originally created by @jredfox on GitHub (Jun 1, 2023).

Windows Terminal version

1.16.230126001

Windows build number

10.0.19045.2965

Other Software

No response

Steps to reproduce

make sure to start windows terminal in command prompt.

@Echo off
set c=%~1%
IF NOT "%c%" == "" (
  set c=%c:$=;%
  echo=%c%
)
pause

command:

C:\Users\jredfox\AppData\Roaming\OpenTerminal\scripts\boot\boot.bat "55$23"

output:

55$23

The issue is pretty clear. WT ignores statements inside of IF statements. I run the same batch and command through conHost.exe and it has no issues changing the $ to ;

Expected Behavior

changing the $ to ;

Actual Behavior

does nothing

Originally created by @jredfox on GitHub (Jun 1, 2023). ### Windows Terminal version 1.16.230126001 ### Windows build number 10.0.19045.2965 ### Other Software _No response_ ### Steps to reproduce make sure to start windows terminal in command prompt. ``` @Echo off set c=%~1% IF NOT "%c%" == "" ( set c=%c:$=;% echo=%c% ) pause ``` command: ``` C:\Users\jredfox\AppData\Roaming\OpenTerminal\scripts\boot\boot.bat "55$23" ``` output: ``` 55$23 ``` The issue is pretty clear. WT ignores statements inside of IF statements. I run the same batch and command through `conHost.exe` and it has no issues changing the `$` to `;` ### Expected Behavior changing the `$` to `;` ### Actual Behavior does nothing
claunia added the Needs-TriageIssue-BugResolution-No-ReproProduct-Cmd.exe labels 2026-01-31 07:00:42 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20013