Bring back ShowWindow functionality #17655

Closed
opened 2026-01-31 05:49:06 +00:00 by claunia · 8 comments
Owner

Originally created by @FoxtrotSierra6829 on GitHub (Jun 8, 2022).

Description of the new feature/enhancement

Bring back ShowWindow functionality as after #13164 only hiding the window works.

Proposed technical implementation details (optional)

Originally created by @FoxtrotSierra6829 on GitHub (Jun 8, 2022). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement Bring back ShowWindow functionality as after #13164 only hiding the window works. <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> # Proposed technical implementation details (optional) <!-- A clear and concise description of what you want to happen. -->
Author
Owner

@DHowett commented on GitHub (Jun 8, 2022):

Do you have a specific need for this, and can you explain it? That would help us prioritize it...

@DHowett commented on GitHub (Jun 8, 2022): Do you have a specific need for this, and can you explain it? That would help us prioritize it...
Author
Owner

@FoxtrotSierra6829 commented on GitHub (Jun 8, 2022):

Yes, I got a node application using https://github.com/felixhao28/node-systray and https://github.com/hetrodoo/hetrodo-node-hide-console-window-napi which is intended to be hidden to tray by default but which can be un-hidden to allow watching status information. While this works very well with windows console host set as default terminal application, it does not with windows terminal.

https://github.com/flybywiresim/simbridge

Windows Console Host

https://user-images.githubusercontent.com/50082450/172674510-04a2487e-2a92-461a-887d-375766216b0a.mp4

Windows Terminal Preview

https://user-images.githubusercontent.com/50082450/172674633-c0f39503-fc81-44aa-b990-983a8d852eee.mp4

@FoxtrotSierra6829 commented on GitHub (Jun 8, 2022): Yes, I got a node application using https://github.com/felixhao28/node-systray and https://github.com/hetrodoo/hetrodo-node-hide-console-window-napi which is intended to be hidden to tray by default but which can be un-hidden to allow watching status information. While this works very well with windows console host set as default terminal application, it does not with windows terminal. https://github.com/flybywiresim/simbridge <details> <summary>Windows Console Host</summary> https://user-images.githubusercontent.com/50082450/172674510-04a2487e-2a92-461a-887d-375766216b0a.mp4 </details> <details> <summary>Windows Terminal Preview</summary> https://user-images.githubusercontent.com/50082450/172674633-c0f39503-fc81-44aa-b990-983a8d852eee.mp4 </details>
Author
Owner

@zadjii-msft commented on GitHub (Jun 8, 2022):

Out of curiosity - how do you expect your app to work in a multi-tab, multi-pane scenario? We don't have a lot of folks even attempting this in the wild, so any and all feedback is appreciated ☺️

  • What would you expect if you tried to ShowWindow(GetConsoleWindow(), SW_SHOW) from an inactive tab? (e.g. user starts the script, switches to another tab and starts working there, and eventually the script in the inactive tab calls ShowWindow)
  • Same question, but for an inactive pane
  • Same as the above questions, but now you've minimized the Terminal (e.g. an inactive tab, in a minimized window, calls ShowWindow)
  • Would outputting the XTWINOPS sequences CSI 1 t and CSI 2 t for show/minimize be possible for you rather than calling ShowWindow on GetConsoleWindow? I don't think that works today, but that might be easier to fix.
@zadjii-msft commented on GitHub (Jun 8, 2022): Out of curiosity - how do you expect your app to work in a multi-tab, multi-pane scenario? We don't have a lot of folks even attempting this in the wild, so any and all feedback is appreciated ☺️ * What would you expect if you tried to `ShowWindow(GetConsoleWindow(), SW_SHOW) `from an inactive tab? (e.g. user starts the script, switches to another tab and starts working there, and eventually the script in the inactive tab calls ShowWindow) * Same question, but for an inactive pane * Same as the above questions, but now you've minimized the Terminal (e.g. an inactive tab, in a minimized window, calls ShowWindow) * Would outputting the [XTWINOPS sequences `CSI 1 t` and `CSI 2 t`](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html) for show/minimize be possible for you rather than calling ShowWindow on `GetConsoleWindow`? I don't think that works today, but that might be easier to fix.
Author
Owner

@DHowett commented on GitHub (Jun 8, 2022):

I've got a couple others:

  • If there are multiple panes currently visible, and the application in one of them decides to hide its "console window", does that pane get sent away?
    • Where to? How can the user discover it if the application doesn't offer a tray icon?
    • What happens if the window that was hosting it, or the tab that was hosting it, is closed in the meanwhile? (The user wouldn't have known the window was harboring an invisible console)
  • How should this work user-driven preferences like "always on top" or the use of the Quake-style window (which is docked at the top of the screen and can be summoned with a hotkey)?
@DHowett commented on GitHub (Jun 8, 2022): I've got a couple others: * If there are multiple panes currently visible, and the application in one of them decides to hide its "console window", does that pane get sent away? * Where to? How can the user discover it if the application doesn't offer a tray icon? * What happens if the window that was hosting it, or the tab that was hosting it, is closed in the meanwhile? (The user wouldn't have known the window was harboring an invisible console) * How should this work user-driven preferences like "always on top" or the use of the Quake-style window (which is docked at the top of the screen and can be summoned with a hotkey)?
Author
Owner

@DHowett commented on GitHub (Jun 8, 2022):

(I'm not asking to discourage you, I'm asking because these are the kinds of things that Terminal forces us to think about. Since it's an upending of the Console infrastructure that has existed on Windows for a few decades, we have to get these things right.)

@DHowett commented on GitHub (Jun 8, 2022): (I'm not asking to discourage you, I'm asking because these are the kinds of things that Terminal forces us to think about. Since it's an upending of the Console infrastructure that has existed on Windows for a few decades, we have to get these things right.)
Author
Owner

@FoxtrotSierra6829 commented on GitHub (Jun 8, 2022):

  • What would you expect if you tried to ShowWindow(GetConsoleWindow(), SW_SHOW) from an inactive tab? (e.g. user starts the script, switches to another tab and starts working there, and eventually the script in the inactive tab calls ShowWindow)

I would expect it to switch the tab to the previously inactive one and focus on it.

  • Same question, but for an inactive pane

I'd expect it to focus on the pane which is tied to the call

  • Same as the above questions, but now you've minimized the Terminal (e.g. an inactive tab, in a minimized window, calls ShowWindow)

It should maximize the Terminal, focus on the tab which is tied to the call and if applicable, focus the specific pane.

  • Would outputting the XTWINOPS sequences CSI 1 t and CSI 2 t for show/minimize be possible for you rather than calling ShowWindow on GetConsoleWindow? I don't think that works today, but that might be easier to fix.

Given my previous answers, this would not behave exactly as described, but at least it would provide some basic functionality. In my case, it might be sufficient as an itermediate solution, tho it would probably not work with hiding it to tray in future either.

  • If there are multiple panes currently visible, and the application in one of them decides to hide its "console window", does that pane get sent away?

I'd expect it to ask for confirmation to hide the entire window, same for tabs. I can't really think of a scenario where one would want to temporarily hide one pane as in that case tabs or multiple windows would be more suitable.

  • How should this work user-driven preferences like "always on top" or the use of the Quake-style window (which is docked at the top of the screen and can be summoned with a hotkey)?

Always on top should be affected in the same way as a minimize call does now, as I expect show and hide calls to be user-desired. Else an option to disable this functionality entirely could be considered. The Quake-style window should be hidden when ShowWindow is being set to false, and restored when ShowWindow is being set to true.

@FoxtrotSierra6829 commented on GitHub (Jun 8, 2022): > - What would you expect if you tried to ShowWindow(GetConsoleWindow(), SW_SHOW) from an inactive tab? (e.g. user starts the script, switches to another tab and starts working there, and eventually the script in the inactive tab calls ShowWindow) I would expect it to switch the tab to the previously inactive one and focus on it. > - Same question, but for an inactive pane I'd expect it to focus on the pane which is tied to the call > - Same as the above questions, but now you've minimized the Terminal (e.g. an inactive tab, in a minimized window, calls ShowWindow) It should maximize the Terminal, focus on the tab which is tied to the call and if applicable, focus the specific pane. > - Would outputting the [XTWINOPS sequences CSI 1 t and CSI 2 t](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html) for show/minimize be possible for you rather than calling ShowWindow on GetConsoleWindow? I don't think that works today, but that might be easier to fix. Given my previous answers, this would not behave exactly as described, but at least it would provide some basic functionality. In my case, it might be sufficient as an itermediate solution, tho it would probably not work with hiding it to tray in future either. > - If there are multiple panes currently visible, and the application in one of them decides to hide its "console window", does that pane get sent away? I'd expect it to ask for confirmation to hide the entire window, same for tabs. I can't really think of a scenario where one would want to temporarily hide one pane as in that case tabs or multiple windows would be more suitable. > - How should this work user-driven preferences like "always on top" or the use of the Quake-style window (which is docked at the top of the screen and can be summoned with a hotkey)? Always on top should be affected in the same way as a minimize call does now, as I expect show and hide calls to be user-desired. Else an option to disable this functionality entirely could be considered. The Quake-style window should be hidden when ShowWindow is being set to false, and restored when ShowWindow is being set to true.
Author
Owner

@ghost commented on GitHub (Aug 18, 2022):

:tada:This issue was addressed in #13624, which has now been successfully released as Windows Terminal v1.14.228.🎉

Handy links:

@ghost commented on GitHub (Aug 18, 2022): :tada:This issue was addressed in #13624, which has now been successfully released as `Windows Terminal v1.14.228`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.14.228) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (Aug 18, 2022):

:tada:This issue was addressed in #13624, which has now been successfully released as Windows Terminal Preview v1.15.228.🎉

Handy links:

@ghost commented on GitHub (Aug 18, 2022): :tada:This issue was addressed in #13624, which has now been successfully released as `Windows Terminal Preview v1.15.228`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.15.228) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17655