Wrong window focused after running batch file #16195

Closed
opened 2026-01-31 05:00:26 +00:00 by claunia · 4 comments
Owner

Originally created by @RichardD2 on GitHub (Dec 17, 2021).

Windows Terminal version

1.11.2921.0

Windows build number

22000.376

Other Software

Windows Explorer

Steps to reproduce

Set Terminal as the default terminal app in Windows 11.

Ensure there are no open Terminal windows.

Open any application - eg: Notepad.

Open Windows Explorer, and locate a batch file.

Double-click the batch file to execute it.

Expected Behavior

The batch file executes, the Terminal window closes, and focus returns to the Windows Explorer window.

Actual Behavior

The batch file executes, the Terminal window closes, and focus returns to the window which had the focus before the Windows Explorer window (eg: Notepad).

This is particularly noticeable if the windows involved are maximized.

Originally created by @RichardD2 on GitHub (Dec 17, 2021). ### Windows Terminal version 1.11.2921.0 ### Windows build number 22000.376 ### Other Software Windows Explorer ### Steps to reproduce Set Terminal as the default terminal app in Windows 11. Ensure there are no open Terminal windows. Open any application - eg: Notepad. Open Windows Explorer, and locate a batch file. Double-click the batch file to execute it. ### Expected Behavior The batch file executes, the Terminal window closes, and focus returns to the Windows Explorer window. ### Actual Behavior The batch file executes, the Terminal window closes, and focus returns to the window which had the focus before the Windows Explorer window (eg: Notepad). This is particularly noticeable if the windows involved are maximized.
Author
Owner

@j4james commented on GitHub (Dec 17, 2021):

It's possible this might be related to #10965 and/or #11601.

@j4james commented on GitHub (Dec 17, 2021): It's possible this might be related to #10965 and/or #11601.
Author
Owner

@zadjii-msft commented on GitHub (Feb 17, 2022):

WOW that's wild. Okay this isn't actually a dupe, and this repros as recently as 10.0.22540.1000

@zadjii-msft commented on GitHub (Feb 17, 2022): WOW that's wild. Okay this isn't actually a dupe, and this repros as recently as `10.0.22540.1000`
Author
Owner

@zadjii-msft commented on GitHub (Apr 27, 2023):

Hmm. I was just trying to repro this on 1.18.1041 and seemingly couldn't even get it to repro on 1.16.10262.0. Is this still broken for you? Or did this get fixed along the way/?

@zadjii-msft commented on GitHub (Apr 27, 2023): Hmm. I was just trying to repro this on 1.18.1041 and seemingly couldn't even get it to repro on 1.16.10262.0. Is this still broken for you? Or did this get fixed along the way/?
Author
Owner

@RichardD2 commented on GitHub (Apr 27, 2023):

Looks like this got fixed - I can't reproduce it in 1.16.10262.0 on Windows 11 22H2 (22621.1555).

@RichardD2 commented on GitHub (Apr 27, 2023): Looks like this got fixed - I can't reproduce it in 1.16.10262.0 on Windows 11 22H2 (22621.1555).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16195