microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.5k stars 8.31k forks source link

Subsequent `wt.exe /min` to an existing window restores a minimized window #18076

Open YO4 opened 1 week ago

YO4 commented 1 week ago

Windows Terminal version

1.22.2702.0

Windows build number

10.0.19045.4894

Other Software

No response

Steps to reproduce

new console creating wt.exe respects /min start /min wt.exe -w exam -> new wt, single tab, minimized start /min wt.exe -w exam sp -> new wt, single tab, minimized, two panes

Expected Behavior

start /min wt.exe -w exam && ^
(echo "sleep 1.0" && ping -n 2 localhost) > NUL && ^
start /min wt.exe -w exam sp

-> minimized wt, single tab, two panes

Actual Behavior

start /min wt.exe -w exam && ^
(echo "sleep 1.0" && ping -n 2 localhost) > NUL && ^
start /min wt.exe -w exam sp

-> visible wt, single tab, two panes

zadjii-msft commented 1 week ago

Hmm. Seems that when the second commandline is tossed at the original window, we summon it, always.

I bet there's a way to not summon it if the commandline had a /min on it.

This is where we're getting the visibility of the request: https://github.com/microsoft/terminal/blob/3a06826915d11ee2124de9b35e42300e1c3f68d5/src/cascadia/WindowsTerminal/WindowEmperor.cpp#L93-L95

Good catch here, thanks!


oneliner

start /min wt.exe -w exam && (echo "sleep 1.0" && ping -n 2 localhost) > NUL && start /min wt.exe -w exam sp