terminal
terminal copied to clipboard
Enable `globalSummon` / `quakeMode` to work even when there isn't a running Terminal
This is probably going to need the "headless monarch" work we theorized. Different parts to this:
- We've already got
startOnUserLogin
which starts the Terminal window. - Is any window the monarch then?
- Is the monarch a phoenix (when it's killed, who restarts it?)
I've had many more thoughts on the matter in the past, I just need to have somewhere to put them.
Is the monarch a phoenix (when it's killed, who restarts it?)
I'm pretty sure this already came to your mind before, but what about using the service approach? It'd only require the tray icon feature to enable the persistence and provide some control over the service itself.
I guess that'd also allow termination commands like exit
, while keeping the globalSummon
or quakeMode
available, for as long as the service is running.
Could it be useful to have some kind of a master orchestrator service? Something like a service to host and manage all WT instances?
Been testing out the preview channel and I LOVE quake mode. Since the terminal is so core to my development workflow, it'd be HUGE if this launched on startup so it felt like a core part of the OS.
Is this issue purely about starting (and keep running) Terminal at startup? I was looking for a way to manually start a terminal in Quake mode, just as asked for in issue #10206.
I was looking for a way to manually start a terminal in Quake mode
That'd be wt -w _quake
. See also the docs
This doesn't work since I have both the stable and the preview version installed, and wt runs the stable version. Most likely I could simply uninstall the stable version. Is there any other way to launch the preview?
Is there any other way to launch the preview?
You could always change wt
to open the Preview version. To do that, you can check out the "Manage app execution aliases" page in the settings
Hmm, if I do this and try to run wt, I get an error from the stable version: [Window Title] C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.8.1521.0_x64__8wekyb3d8bbwe\wt.exe
[Content] Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item.
OK, when I remove the stable version running wt successfully launches the preview, and also launching in Quake mode works fine. Thanks a lot! Now I only need to figure out how I can add this command as a shortcut to my start menu 🙈
If there were an option to start Windows Terminal in Quake mode, but hidden, that would solve it in my book.
Something like this: wt -w _quake --hidden
Another idea suggested in #13210 - start Terminal minimized to the tray on system startup.
I'm not sure how I feel about that. Initial thoughts is that I'd want to avoid that solution, since it would incur starting the user's shell(s) at startup, and having them running until the user actually invokes the Terminal. (I should be OOF this week so I'm not gonna give this much more thought ATM beyond just de-duping threads)
This minimized to tray on startup is quite frequent among other apps. If needed, spawning actual shell / profile can be postponed until the first summon (especially for WSLv2 shells that spawn a virtual machine and occupy a lot of RAM), but the rest of the app would already be initialized.
And in quake scenario, having Terminal occupying space in the app bar is wasteful, having one in tray is sufficient.
Unless there's other useful functionality associated with it, I'd personally rather not have yet another thing cluttering the overflow menu of the notification tray (and definitely not in the taskbar.)
To me this feature should feel like an ambient operating system thing.
For the moment launching minimized to tray could be solved with a new command line option "--minimized"
"Launch on machine startup" and "Always display an icon in the notification area" both enabled achieves similar behaviour to what I'm used to with always-available Quake mode terminals on macOS and Linux, but it's not perfect.
I have to accept the always-present tray icon that does nothing and is either visible or not visible when a normal Terminal window is open (depending on how you configure it), and I have to manually close the default Terminal window that opens on startup every time (although I'll try @JJRcop's suggestion to suppress that). Plus, when I open the Quake terminal, it appears as another Terminal window in the taskbar.
Ideally, there would be an option to launch into the background without any window at startup, and an option to have Terminal running in the background but without yet another tray icon. Anyone using Quake mode is a developer or a power user, if Terminal breaks or needs restarting we know how to kill it from Task Manager without a tray icon adding clutter.
Definitely like @PathogenDavid's perspective that if Quake mode is enabled, it should just be available whenever without jumping through a sequence of obscure configuration options and workarounds. I know some Linux desktop environments do that already and it's really nice.
(although I'll try @JJRcop's suggestion to suppress that)
Sorry, allow me to clarify that --minimized
does not currently exist, and my suggestion is directed towards near-future quick-fix development rather than towards current usage.
I just edited my comment to hopefully make this clear, oops.
My sincerest apologies, sorry for any misunderstanding. 😅
FWIW, --minimized
is tracked in #7374
Probably missing something, but I don't see a reason to have anything start with the OS unless there is some large configuration to load that took an inordinate amount of time. When you hit your launcher Hotkey, it should just launch directly into quake mode as the title suggests. Having a taskbar icon doesn't bother me at all as it tucks away in the overflow and just gives another way to interact with the program to access settings or kill the program for people who are used to working that way. There really doesn't need to be an icon in the app bar though when using quake mode. Having quake mode enabled pretty much insinuates you will be accessing your terminal via hotkey, so an app bar icon should at least be configurable if it's not desired.
Linux has perfected most of these issues over the years. I use XFCE4-terminal and it does almost everything perfectly. After booting is finished I just hit F12 and it launches nearly instantly. It has a tray icon but not an app icon. If I launch any additional instances it opens in a regular window with an app bar icon, but it doesn't affect my quake mode instance. I can also launch programs directly into a new tab of my existing running quake mode instance which is extremely handy for my custom actions in Thunar.
I only use Windows at work but I am truly grateful to have WT with quake mode now. If there is one thing I actually prefer with WT, is the ability to open with a pre defined set of tabs. (though the tabs should really be on the bottom of the window imho, (and visible) )
Lastly, it may be trivial, but I do wish the window would slide down from the top instead of opening across the screen from the bottom.
When you hit your launcher Hotkey, it should just launch directly into quake mode as the title suggests.
Unfortunately, the problem is that we can't do that without having something launched before you press the hotkey to register for it and intercept it when you press it.
The only other way for us to accomplish it without pre-launching something would be to add a hook in the Windows shell, which wouldn't come out to users for another 1,000 years and then would only be available to people with Intel Core i48 processors.
Unfortunately, the problem is that we can't do that without having something launched before you press the hotkey to register for it and intercept it when you press it.
Thank you for the reply and sorry for my ignorance, but couldn't you use a systemwide hotkey to launch wt with the options you wanted? (ie.. create a shortcut and assign it a "shortcut key"?) If it determines the program is already open, it would function as a visibility toggle, otherwise it would spawn the program itself. It wouldn't be a hotkey that you configure within wt itself, but not sure that would matter if it accomplished the same goal.
I admit my ignorance on the inner workings of Windows, so again I apologize if there is something fundamentally flawed with this approach. It is completely useable as is and I'm glad to have it. Thanks for your hard work!
HUH. Now that you mention it . . . shortcuts do support that! I wonder if they need to be placed in a specific directory, or need some other special treatment.
That's an excellent idea. Thank you! Is it I who was ignorant!
I wonder if they need to be placed in a specific directory
I thought they could be anywhere, but it seems they must be on the desktop or a folder on the desktop. (Maybe other places too, but it's definitely not anywhere.)
It's worth noting it doesn't support shortcuts involving the Windows key (at least the UI doesn't let you create them.) Additionally, on my PC at least there's a pretty significant/unacceptable delay between me pressing the shortcut and the application actually launching.
I kinda get the vibe that this feature exists mainly due to legacy momentum. It's been around since at least Windows 95:
It's definitely an interesting feature from a trivia perspective, but I doesn't feel particularly well-suited for this task IMO.
LoL, it's always something with Windows.
From glossing over this answer to the problem, it seems like it's fixable, but may not be worth the trouble for some. There are programs out there like this which may offer a solution, but again I'm not sure it's worth the trouble for most.
Such a shame it's got to be this difficult. Systemwide shortcuts should just work out of the box. :\
I don't think I'd want to rely on Windows Desktop shortcuts since it seems like a janky forgotten feature that could be axed by Explorer for security reasons at any time. I think it was added back when Active Desktop was all the rage. "Let's replace your desktop wallpaper with an IE4 instance, what could possibly go wrong?"
Thinking about the UX from the perspective of an end-user who just wants to use the product without participating in its development: If Terminals' goal is to become a first-class citizen for Windows on par with most Linux DEs, then shell integration should be on the long-term roadmap regardless. If we're already able to replace the default console host with WT, then shell integration and Windows shipping with WT pre-installed should both be inevitable. If that's going to take a long time, then those conversations should be started now so it's at least on the right people's radars.
If that's not feasible, that's not a technical problem, that's a management and product roadmap problem. To be frank, end users don't care that Microsoft's corporate culture insists on pitting its own teams against each other, competing in parallel to solve the same problems.
A means to run WT minimised to the tray on startup (and WT itself listens for the Quake mode shortcut key), or a startup background helper to launch Terminal in Quake mode the first time the shortcut is pressed are both sensible short-term compromises. I don't have a strong preference either way; but I'd like the option to choose when the shell init happens (pre-emptively or deferred) and hide the tray icon.
PowerToys offers a mechanism to rebind system shortcuts, but doesn't have a mechanism to create new ones. However it also offers a modular architecture to run small tools in the background which add supplementary functionality to apps for power users. Maybe the Quake mode trigger helper would be a good candidate for that? It would synergise well with the keyboard remapping toy, and if it was generic it could be used for other tools too. (custom macro boards, game controllers, accessibility utilities, etc.)
fun fact, the desktop shortcut doesn't work properly if you select minimized in shortcut options, it results in the wt instance being spawned off screen and the only way to get it to show up after a restart is restarting WT or toggling full-screen then using win+arrow keys to move it back onto the desktop :/ this is also related too #9053 and others mentioned their, this is a decent work around if you only intend on using quake mode, however if you have windows terminal set too attach to an already opened instance you cant use WT from anywhere but win + ` until you use above workarounds, this was tested just now using windows terminal preview on windows 11
dirty way to start it minimized: wt -w _quake powershell -nologo -window minimized
dirty way to start it minimized:
wt -w _quake powershell -nologo -window minimized
That's exactly what I was looking for. Thank you so much! I can't quite figure out how to pass a particular Windows Terminal profile though. I tried the following, but it pops up an error about the -window
argument being unexpected.
wt -w _quake -p "PowerShell" -window minimized
Ah, the ages-old issue with -p x
. You'll need to specify a command to run using that profile¹; try wt -w _quake -p PowerShell pwsh -nologo -window minimized
¹ why is this the case?
Passing a command on the commandline overrides the profile's command, it doesn't add to it (various reasons this is true, one of which is that appending arguments to cmd
profiles would require cmd /s /c
and appending to powershell profiles would require -command
, unless you wanted to pass arguments and not a command, at which point it's all for naught really... see docker's ENTRYPOINT
for all the terribly fun ways this can fall apart 😄)
Note that this doesn't seem to apply all settings for the given profile. For example, the set Font is not applied.
For now, I'm using this shortcut:
pwsh -c "Start-Process wt.exe -WindowStyle Hidden"
with Run:
Minimized
To run
Start-Process wt.exe -WindowStyle Hidden
in a short-lived, minimized conhost window.
Aside from (1) the conhost/pwsh icon that pops up on the taskbar very briefly on login (blink and you'll miss it), and (2) the fact that global summon / quake mode will stop working if you close all your terminals, this workaround.... well, works around the issue.
wt -w _quake powershell -nologo -window minimized
I really wished I could somehow only run this command once since the _quake
window always pops up then quickly disappears every time a new window is opened (aka new instance in which the profile has to be re-init)