Command-line to toggle visibility #17685

Open
opened 2026-01-31 05:50:10 +00:00 by claunia · 5 comments
Owner

Originally created by @gapf2010 on GitHub (Jun 11, 2022).

Description of the new feature/enhancement

I'm proposing a command-line option to toggle the visibility of the terminal window. It should do exactly that: if I run (for instance) "wt --toggle" it should create a new window with default profile and show it (if no window exists) or show the current window (if one already exists). If the window is currently being displayed, running "wt --toggle" should hide the window and focus the previously selected application. This can be complemented with an option to make it that if "wt --toggle" creates the window, then it won't make it visible (useful on startup of terminal). A second run of "wt --toggle" will make the window visible.

Proposed technical implementation details (optional)

Not sure about how to do this. Maybe a switch that will run the same "toggle visibility" internal command of terminal, or something? however that does not seem to be exactly what I described above.

Originally created by @gapf2010 on GitHub (Jun 11, 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 <!-- --> I'm proposing a command-line option to toggle the visibility of the terminal window. It should do exactly that: if I run (for instance) "wt --toggle" it should create a new window with default profile and show it (if no window exists) or show the current window (if one already exists). If the window is currently being displayed, running "wt --toggle" should hide the window and focus the previously selected application. This can be complemented with an option to make it that if "wt --toggle" creates the window, then it won't make it visible (useful on startup of terminal). A second run of "wt --toggle" will make the window visible. # Proposed technical implementation details (optional) <!-- A clear and concise description of what you want to happen. --> Not sure about how to do this. Maybe a switch that will run the same "toggle visibility" internal command of terminal, or something? however that does not seem to be exactly what I described above.
claunia added the Issue-TaskProduct-TerminalArea-CommandlineArea-Remoting labels 2026-01-31 05:50:10 +00:00
Author
Owner

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

This kinda sounds like the globalSummon action to me, but with more steps. Not saying that it's invalid, but I suppose I'm curious - is there a reason globalSummon doesn't work for your use case/?

Presumably, it wouldn't be too hard to just plumb through wt summon as a globalSummon action, if you really needed this on the commandline for some reason.

@zadjii-msft commented on GitHub (Jun 13, 2022): This kinda sounds like the [`globalSummon`](https://docs.microsoft.com/en-us/windows/terminal/customize-settings/actions#global-summon) action to me, but with more steps. Not saying that it's invalid, but I suppose I'm curious - is there a reason globalSummon doesn't work for your use case/? Presumably, it wouldn't be too hard to just plumb through `wt summon` as a `globalSummon` action, if you really needed this on the commandline for some reason.
Author
Owner

@gapf2010 commented on GitHub (Jun 14, 2022):

This kinda sounds like the globalSummon action to me, but with more steps. Not saying that it's invalid, but I suppose I'm curious - is there a reason globalSummon doesn't work for your use case/?

Presumably, it wouldn't be too hard to just plumb through wt summon as a globalSummon action, if you really needed this on the commandline for some reason.

Hi. Well, for me gobalSummons does not work, because it seems I cannot bind F12 to summon the terminal. F12 works on Linux and OSX, but for some reason it does not work on Windows for me. However, I found my Lenovo PC has a way to run a custom command when pressing F12, and that's what I'd like to use with this option I'm proposing.

Thanks.

@gapf2010 commented on GitHub (Jun 14, 2022): > This kinda sounds like the [`globalSummon`](https://docs.microsoft.com/en-us/windows/terminal/customize-settings/actions#global-summon) action to me, but with more steps. Not saying that it's invalid, but I suppose I'm curious - is there a reason globalSummon doesn't work for your use case/? > > Presumably, it wouldn't be too hard to just plumb through `wt summon` as a `globalSummon` action, if you really needed this on the commandline for some reason. Hi. Well, for me gobalSummons does not work, because it seems I cannot bind F12 to summon the terminal. F12 works on Linux and OSX, but for some reason it does not work on Windows for me. However, I found my Lenovo PC has a way to run a custom command when pressing F12, and that's what I'd like to use with this option I'm proposing. Thanks.
Author
Owner

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

I found my Lenovo PC has a way to run a custom command when pressing F12

Ah, well, that might explain why you can't bind F12 in the Terminal - I suppose the PC has already stolen that keybinding away from us 😄

@zadjii-msft commented on GitHub (Jun 14, 2022): > I found my Lenovo PC has a way to run a custom command when pressing F12 Ah, well, that might explain why you can't bind <kbd>F12</kbd> in the Terminal - I suppose the PC has already stolen that keybinding away from us 😄
Author
Owner

@gapf2010 commented on GitHub (Jun 14, 2022):

I found my Lenovo PC has a way to run a custom command when pressing F12

Ah, well, that might explain why you can't bind F12 in the Terminal - I suppose the PC has already stolen that keybinding away from us 😄

I thought the same, but then I noticed that the Lenovo software actually does not bind to F12, but to Fn+F12 and even then, it's not currently enabled. F12 is not bound to anything AFAIK, because pressing it on a software that uses it (like Edge or Chrome) does what it's supposed to do on that software, so no other app uses F12 exclusively. If you can configure your terminal to open with F12 and could share the config here, I'd appreciate it. Anyway, I still think my original request would be useful.

@gapf2010 commented on GitHub (Jun 14, 2022): > > I found my Lenovo PC has a way to run a custom command when pressing F12 > > Ah, well, that might explain why you can't bind F12 in the Terminal - I suppose the PC has already stolen that keybinding away from us 😄 I thought the same, but then I noticed that the Lenovo software actually does not bind to F12, but to Fn+F12 and even then, it's not currently enabled. F12 is not bound to anything AFAIK, because pressing it on a software that uses it (like Edge or Chrome) does what it's supposed to do on that software, so no other app uses F12 exclusively. If you can configure your terminal to open with F12 and could share the config here, I'd appreciate it. Anyway, I still think my original request would be useful.
Author
Owner

@zadjii-msft commented on GitHub (Aug 10, 2022):

Note: this is as described in #12135.

I'll use this for the summon subcommand, and then leave the other issue for --profile

@zadjii-msft commented on GitHub (Aug 10, 2022): Note: this is as described in #12135. I'll use this for the `summon` subcommand, and then leave the other issue for `--profile`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17685