CTRL-C of a batch file running in CMD prompt loses terminal focus #19011

Closed
opened 2026-01-31 06:31:07 +00:00 by claunia · 5 comments
Owner

Originally created by @iwilliamson on GitHub (Dec 2, 2022).

Windows Terminal version

1.16.2641.0

Windows build number

10.0.19044.2251

Other Software

No response

Steps to reproduce

  1. Create a batch file that takes some time
  2. Hit CTRL-C to abort the batch file
  3. Notice the "Cancel batch job C:\batch.bat ? (Y/N/A) :"
  4. Try and press "A"
  5. The window no longer has focus - nothing happens
  6. Click the mouse in the CMD window
  7. Press "A"

Expected Behavior

  1. Create a batch file that takes some time
  2. Hit CTRL-C to abort the batch file
  3. Notice the "Cancel batch job C:\batch.bat ? (Y/N/A) :"
  4. Press "A"
  5. The batch file aborts

No mouse usage necessary.

Actual Behavior

See the steps to reproduce

Originally created by @iwilliamson on GitHub (Dec 2, 2022). ### Windows Terminal version 1.16.2641.0 ### Windows build number 10.0.19044.2251 ### Other Software _No response_ ### Steps to reproduce 1. Create a batch file that takes some time 2. Hit CTRL-C to abort the batch file 3. Notice the "Cancel batch job C:\batch.bat ? (Y/N/A) :" 4. Try and press "A" 5. The window no longer has focus - nothing happens 6. Click the mouse in the CMD window 7. Press "A" ### Expected Behavior 1. Create a batch file that takes some time 2. Hit CTRL-C to abort the batch file 3. Notice the "Cancel batch job C:\batch.bat ? (Y/N/A) :" 4. Press "A" 5. The batch file aborts No mouse usage necessary. ### Actual Behavior See the steps to reproduce
claunia added the Needs-TriageIssue-BugResolution-ExternalNeeds-Attention labels 2026-01-31 06:31:07 +00:00
Author
Owner

@iwilliamson commented on GitHub (Dec 2, 2022):

I stand slightly corrected. This seems to be an interaction with the "TCC" command line replacement. Not CMD.exe itself.

@iwilliamson commented on GitHub (Dec 2, 2022): I stand slightly corrected. This seems to be an interaction with the "TCC" command line replacement. Not CMD.exe itself.
Author
Owner

@zadjii-msft commented on GitHub (Dec 2, 2022):

I stand slightly corrected. This seems to be an interaction with the "TCC" command line replacement. Not CMD.exe itself

So, should we resolve this as an external bug/?

@zadjii-msft commented on GitHub (Dec 2, 2022): > I stand slightly corrected. This seems to be an interaction with the "TCC" command line replacement. Not CMD.exe itself So, should we resolve this as an external bug/?
Author
Owner

@iwilliamson commented on GitHub (Dec 2, 2022):

I think so. I also submitted it to JPSoft since it seems to only happen with their software. I'll bring it back up if it comes back this way.

Sorry.

@iwilliamson commented on GitHub (Dec 2, 2022): I think so. I also submitted it to JPSoft since it seems to only happen with their software. I'll bring it back up if it comes back this way. Sorry.
Author
Owner

@DHowett commented on GitHub (Dec 2, 2022):

Sorry.

Hey, not a problem at all! We're one huge community of command line app users, at the end of the day. Happy we could get some closure (?) on this 😄

@DHowett commented on GitHub (Dec 2, 2022): > Sorry. Hey, not a problem at all! We're one huge community of command line app users, at the end of the day. Happy we could get some closure (?) on this :smile:
Author
Owner

@iwilliamson commented on GitHub (Dec 7, 2022):

I have a work around, but this is being discussed at: https://jpsoft.com/forums/threads/windows-terminal-interaction-with-aborting-batch-files-window-loses-focus.11336/ and the consensus there seems to be that this is a Microsoft Terminal bug.

Maybe someone in the know can chime in and give the Terminal Developer's perspective.

@iwilliamson commented on GitHub (Dec 7, 2022): I have a work around, but this is being discussed at: https://jpsoft.com/forums/threads/windows-terminal-interaction-with-aborting-batch-files-window-loses-focus.11336/ and the consensus there seems to be that this is a Microsoft Terminal bug. Maybe someone in the know can chime in and give the Terminal Developer's perspective.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19011