-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable globalSummon
/ quakeMode
to work even when there isn't a running Terminal
#9996
Comments
globalSummon
/ quakeMode
to work even when there isn't a running Terminal
I'm pretty sure this already came to your mind before, but what about using the service approach? I guess that'd also allow termination commands like 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. |
That'd be |
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? |
You could always change |
Hmm, if I do this and try to run wt, I get an error from the stable version: [Content] |
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: |
This comment was marked as off-topic.
This comment was marked as off-topic.
I use the following hotkey in Autohotkey to help enable this: $#`::
If (ProcessExist("WindowsTerminal.exe"))
Send #``
else
Run "wt"
:: I couldn't get this to actually start in quake mode, so in reality what i have to do is press `#``, this opens terminal, then press it again to get quake mode, then again to hide it, then close the original terminal. This is far from optimal but at least gives me a single hotkey to get terminal open and into quake mode without having to open wt through some other means. |
Meanwhile, can the preview release of WT point to a schema with these keys in it? |
Try this: ProcessExist(Name){
Process,Exist,%Name%
return Errorlevel
}
#If !ProcessExist("WindowsTerminal.exe")
#`::
Run wt -w _quake
Return |
Since it would open a new shell nested in default shell, I put |
As of my current posting date, after reading all the above, this works for me As a startup task. (By default it won't run the initial user profile; if you don't care about this, feel free to remove the command and even Inside your settings.json (so you can still open quake after terminal/quake windows are closed) Now it always shows up no matter what (seems that a side effect as of the latest version of this posting date, is actual terminal windows open behind all others) |
I followed your instructions and got this error:
I also read all above. Please clarify the exact command for the "target" field of startup shortcut.
|
@unennhexium I have mine in a task schedule job. (trigger at log in, action start a program) I'm sure a shortcut way exists, but I have no need to experiment with that since it's already working for me. In either case, I noticed your command is In either case, I don't know exactly what you're doing, so I can't really debug that for you. The usual rules apply. Make sure (Also, while writing this, I noticed I should use |
@MolotovCherry could you please tell me what |
@amzon-ex According to microsoft docs, it:
So, it just keeps the shell open after running a command. |
Could you describe in detail what you do? I do the following
🚩This also happens if I simply open a new tab with this profile in an already active terminal window. |
Ok. I did this using Task Scheduler
Just in case, I'm replacing ✅Checking accessAdministrator_PowerShell_2023-11-04.01-40-47-Trim.mp4I also did not include any additional quotation or other chars. I checked for extra spaces inside and at the ends of the command and its arguments. None of this was found. This method still doesn't work for me. The Task Scheduler allows to export tasks in ✏️wt_task.xml<?xml version="1.0" encoding="UTF-16"?> <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> <RegistrationInfo> <Date>2023-11-03T19:04:05.6192719</Date> <Author>LAPTOP-PC\User</Author> <Description>Launches Windows Terminal in the background to be activated in Quake mode using (⊞ + `) in the future</Description> <URI>\Windows Terminal</URI> </RegistrationInfo> <Triggers> <LogonTrigger> <Enabled>true</Enabled> </LogonTrigger> </Triggers> <Principals> <Principal id="Author"> <UserId>S-1-5-21-3286135726-1618621029-3948465185-1014</UserId> <LogonType>InteractiveToken</LogonType> <RunLevel>LeastPrivilege</RunLevel> </Principal> </Principals> <Settings> <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy> <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries> <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries> <AllowHardTerminate>true</AllowHardTerminate> <StartWhenAvailable>false</StartWhenAvailable> <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable> <IdleSettings> <StopOnIdleEnd>true</StopOnIdleEnd> <RestartOnIdle>false</RestartOnIdle> </IdleSettings> <AllowStartOnDemand>true</AllowStartOnDemand> <Enabled>true</Enabled> <Hidden>false</Hidden> <RunOnlyIfIdle>false</RunOnlyIfIdle> <WakeToRun>false</WakeToRun> <ExecutionTimeLimit>PT72H</ExecutionTimeLimit> <Priority>7</Priority> </Settings> <Actions Context="Author"> <Exec> <Command>C:\Users\User\AppData\Local\MIcrosoft\WindowsApps\wt.exe</Command> <Arguments>-w _quake pwsh -nologo -window minimized</Arguments> <WorkingDirectory>C:\Users\User</WorkingDirectory> </Exec> </Actions> </Task> |
@unennhexium Your task works fine for me verbatim (except I changed the user path to mine). |
In |
I can't believe we still don't have a WT argument --minimized yet. The solutions proposed here do not work flawlessly, one (big) caveat for me was losing the ability to open your default profile Elevated / as administrator, even if configured on WT. My workaround to have it as ADMIN was similar to above:
Still, can we PLEASE get a |
Could we know what is stopping the devs from implementing a proper option to start windows terminal in the background on startup if we want this? The whole idea behind quake mode is to have a hotkey that opens the terminal at any time from anywhere without any previous intervention to "prep" it beforehand. |
Time, basically. I haven't had the chance to loop back around on Not sure when exactly I'll have a chance to. I don't think these would be terribly difficult if someone in the community wanted to contribute either here. I could definitely provide guidance and pointers if someone runs into any questions. |
In regards to running as admin, I use PowerToys' Keyboard Manager to run terminal on CTRL+ALT+T, and CTRL+SHIFT+ALT+T runs it as administrator. |
When using powertoys Keyboard Manager to run terminal is there a way to make it not open a new tab when a window already exists? In other way to make the command create a window when none exists or just invoke the existing tab instead of opening a new one whe it does? |
For your purpose, autohotkey will work. It doesn't work perfectly with minimized terminal windows, but as a temporary solution it's great. Don't forget to change keyboard shortcuts if necessary. #Requires AutoHotkey v2.0
#SingleInstance
DetectHiddenWindows true
terminalName := "WindowsTerminal.exe"
; [Win Shift Enter] If the terminal is already open, activate it. Otherwise, open it.
#+Enter:: {
if (pid := ProcessExist(terminalName)) {
if WinExist("ahk_pid" pid) {
PostMessage 0x0112, 0xF120, , , WinGetID("ahk_pid" pid)
WinActivate
}
} else {
Run("wt")
}
}
; [Win Enter] Open the terminal in a new window.
#Enter:: {
Run("wt")
}
; [Win `] Open the terminal in a quake mode. Only works if the terminal is not already open. Require setting same hotkey in the terminal.
#HotIf !ProcessExist(terminalName)
#`:: {
Run("wt -w _quake")
} To work correctly with minimized windows, you should enable this option in the settings: |
For anyone on Windows 11, you can start a new Terminal using WIN+X, followed by I for Terminal or A for elevated Terminal. |
Has something recently changed with WindowsTerminal reusing processes for its windows? I have my own super-monitor program that handles showing the quake terminal and toggling it when Win+` is pressed, due to this issue. I used to be able to launch "wt.exe -w _quake" and then find the WindowsTerminal process with "-w _quake" in its command line in order to then find the quake terminal window associated with that process. However, it seems that no matter how many times you launch wt.exe, it now only creates a single elevated and non-elevated process, and I no longer have any way to track down the quake terminal window so I can toggle its visibility. All non-elevated windows are getting stuffed into whatever existing WindowsTerminal process there is. (Edit: looks like I should be able to find the quake windows again by looking for terminal windows with a hidden DRAG_BAR_WINDOW_CLASS child window.) |
@User1785604260 That changed in 1.18, like, two years ago. Ever since that release, all Terminal windows are the same process (and after 1.23, they'll all be on the same thread too) |
First off, love the work done with Windows Terminal and over all the whole dev ecosystem with the introduction of WSL. I have been going down the rabbit hole of the many discussions on this topic. Currently, we can utilize the windows hotkeys: Win + x then i to fire the Terminal application. The only thing I wasn't clear on yet, do we have an elegant solution to streamline this process to happen automatically on start up? Currently I have the "Start terminal instance on start-up" checked and so I don't even have to go through the Win + x then i so essentially, I only have to initiate the quake mode by hitting Win + ` with the terminal opened on start-up. I know this is now small issue to even think about since I would only have to do this once when working on my PC, but are there any plans for a native solution/ setting to make the above actions happen without the intermediary step of having a Terminal open to initiate the default Terminal instance in Quake Mode on start up? |
This is probably going to need the "headless monarch" work we theorized. Different parts to this:
startOnUserLogin
which starts the Terminal window.I've had many more thoughts on the matter in the past, I just need to have somewhere to put them.
The text was updated successfully, but these errors were encountered: