[Bug] "Open in Terminal" focuses on last session instead of selected folder #22383

Open
opened 2026-01-31 08:11:36 +00:00 by claunia · 0 comments
Owner

Originally created by @Gorrrg on GitHub (Oct 12, 2024).

Windows Terminal version

7.4.5

Windows build number

22631.4317

Other Software

Using Terminal in combination with File Explorer has a certain risk. When you have closed Terminal with open sessions, it will focus on the last session NO MATTER how you have started Terminal again. Literally focusing on a session open in folder A, even though Terminal was started by the user telling it to open a new session in folder X. When you don't know this and start typing your commands right away without checking you might end up destroying your data depending on the operations you do. I happened to me in a hurry. It destroys your workflow. It opens two Terminal windows, one with the old sessions and a new window with the new session you've openend via the Explorer, but for some stupid reason the former gets the focus.

Steps to reproduce

  • Open a few sessions in folders A, B, C.
  • Close Terminal
  • Use File Explorer to "Open in Terminal" folder X
  • There a now two Terminal windows, and focus is on the one with the old sessions instead of the session you have started Terminal again for

Expected Behavior

Open one Terminal window, add the new session to it, and give it focus. Or open two Terimal windows, the old session and in addition a new window with the new session that you actually want to work in, but focus on the latter.

Actual Behavior

Old session steals the focus, you have to manually switch to the session you have just started with "Open in Terminal".

Originally created by @Gorrrg on GitHub (Oct 12, 2024). ### Windows Terminal version 7.4.5 ### Windows build number 22631.4317 ### Other Software Using Terminal in combination with File Explorer has a certain risk. When you have closed Terminal with open sessions, it will focus on the last session NO MATTER how you have started Terminal again. Literally focusing on a session open in folder A, even though Terminal was started by the user telling it to open a new session in folder X. When you don't know this and start typing your commands right away without checking you might end up destroying your data depending on the operations you do. I happened to me in a hurry. It destroys your workflow. It opens two Terminal windows, one with the old sessions and a new window with the new session you've openend via the Explorer, but for some stupid reason the former gets the focus. ### Steps to reproduce - Open a few sessions in folders A, B, C. - Close Terminal - Use File Explorer to "Open in Terminal" folder X - There a now two Terminal windows, and focus is on the one with the old sessions instead of the session you have started Terminal again for ### Expected Behavior Open one Terminal window, add the new session to it, and give it focus. Or open two Terimal windows, the old session and in addition a new window with the new session that you actually want to work in, but focus on the latter. ### Actual Behavior Old session steals the focus, you have to manually switch to the session you have just started with "Open in Terminal".
claunia added the Issue-BugPriority-3Product-TerminalArea-Windowing labels 2026-01-31 08:11:36 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#22383