Skip to content

Bring back ShowWindow functionality #13248

Closed

Description

Description of the new feature/enhancement

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

Proposed technical implementation details (optional)

Activity

  1. added
    Issue-Feature
    on Jun 8, 2022
  2. ghost added
    Needs-Triage
    on Jun 8, 2022
  3. ghost added
    Needs-Tag-Fix
    on Jun 8, 2022
  4. DHowett commented on Jun 8, 2022

    @DHowett
    Member

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

  5. added
    Needs-Author-Feedback
    on Jun 8, 2022
  6. FoxtrotSierra6829 commented on Jun 8, 2022

    @FoxtrotSierra6829
    Author

    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
    simbridge.windows.console.host.mp4
    Windows Terminal Preview
    simbridge.windows.terminal.preview.mp4
  7. ghost added
    Needs-Attention
    on Jun 8, 2022
  8. ghost removed
    Needs-Author-Feedback
    on Jun 8, 2022
  9. zadjii-msft commented on Jun 8, 2022

    @zadjii-msft
    Member

    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.
  10. DHowett commented on Jun 8, 2022

    @DHowett
    Member

    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)?
  11. DHowett commented on Jun 8, 2022

    @DHowett
    Member

    (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.)

  12. FoxtrotSierra6829 commented on Jun 8, 2022

    @FoxtrotSierra6829
    Author
    • 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.

  13. added
    Issue-Question
    Product-Terminal
    Issue-Task
    Area-Windowing
    and removed
    Issue-Feature
    Needs-Triage
    Needs-Attention
    on Aug 1, 2022
  14. ghost removed
    Needs-Tag-Fix
    on Aug 1, 2022
  15. ghost added
    In-PR
    on Aug 1, 2022
  16. ghost closed this as completedin #13624on Aug 1, 2022
  17. ghost added a commit that references this issue on Aug 1, 2022
    d1fc112
  18. ghost removed
    In-PR
    on Aug 1, 2022
  19. ghost added
    Resolution-Fix-Committed
    on Aug 1, 2022
  20. added a commit that references this issue on Aug 8, 2022
    b670800
  21. added a commit that references this issue on Oct 15, 2022
    ac9d697
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-WindowingIssue-QuestionIssue-TaskProduct-TerminalResolution-Fix-Committed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions