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

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

Original Pull Request: https://github.com/microsoft/terminal/pull/13624

State: closed
Merged: Yes


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.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/13624 **State:** closed **Merged:** Yes --- 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
claunia added the pull-request label 2026-01-31 09:36:14 +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#29671