Wrong window focused after running batch file #16192

Open
opened 2026-01-31 05:00:18 +00:00 by claunia · 0 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16192