[PR #13624] [MERGED] Restore the ability for alt+tab to restore the Terminal after minimizing with taskbar #29666

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/13624
Author: @zadjii-msft
Created: 7/28/2022
Status: Merged
Merged: 8/1/2022
Merged by: @undefined

Base: mainHead: dev/migrie/13589-windowing-bodge


📝 Commits (1)

  • 9c53724 Restore the ability for alt+tab to restore the Terminal after minimizing with taskbar

📊 Changes

2 files changed (+39 additions, -26 deletions)

View changed files

📝 src/cascadia/WindowsTerminal/IslandWindow.cpp (+13 -3)
📝 src/interactivity/base/InteractivityFactory.cpp (+26 -23)

📄 Description

Curiously, at least on Windows 10 (and rarely on Windows 11), if you minimize the Terminal by clicking on the taskbar, then alt-tab to try and restore the window, the Taskbar will decide to call SwitchToWindow on the invisible, owned ConPTY window instead of the main window. When that happens, ConPTY'll get a WM_SIZE(SIZE_RESTORED, lParam=0). The main window will NOT get a SwitchToWindow called. If ConPTY doesn't actually inform the hosting process about this, then the main HWND might stay hidden.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/13624 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 7/28/2022 **Status:** ✅ Merged **Merged:** 8/1/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/migrie/13589-windowing-bodge` --- ### 📝 Commits (1) - [`9c53724`](https://github.com/microsoft/terminal/commit/9c53724019d4148c6f60c20bee621b77dc988476) Restore the ability for alt+tab to restore the Terminal after minimizing with taskbar ### 📊 Changes **2 files changed** (+39 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/WindowsTerminal/IslandWindow.cpp` (+13 -3) 📝 `src/interactivity/base/InteractivityFactory.cpp` (+26 -23) </details> ### 📄 Description Curiously, at least on Windows 10 (and rarely on Windows 11), if you minimize the Terminal by clicking on the taskbar, then alt-tab to try and restore the window, the Taskbar will decide to call `SwitchToWindow` on the invisible, owned ConPTY window instead of the main window. When that happens, ConPTY'll get a `WM_SIZE(SIZE_RESTORED, lParam=0)`. The main window will NOT get a `SwitchToWindow` called. If ConPTY doesn't actually inform the hosting process about this, then the main HWND might stay hidden. * Refer to #13158 where we disabled this. * Closes #13589 * Closes #13248 * Tested manually on a Windows 10 VM. * Confirmed that opening tabs while maximized/snapped doesn't restore down. * `[Native]::ShowWindow([Native]::GetConsoleWindow(), 6)` still works --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:36:13 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#29666