No way to open an existing quake-mode terminal with command line #14979

Closed
opened 2026-01-31 04:24:56 +00:00 by claunia · 4 comments
Owner

Originally created by @pfmoore on GitHub (Aug 26, 2021).

Windows Terminal version (or Windows build number)

10.0.19042.0, 1.9.1942.0

Other Software

N/A

Steps to reproduce

Open a "quake mode" terminal (for example, run wt -w _quake).
At a command prompt (either the terminal you just opened, or Win-R) run wt -w _quake.

Expected Behavior

The existing quake-mode terminal gets the focus

Actual Behavior

A new quake-mode window is opened.

I believe this is because the default wt command is new-tab, which creates a new tab (in quake mode, this is a new window). I would be perfectly happy with having to explicitly specify a different command - but none of the ones I've tried seem to work. I have been unable to find a wt command that switches to an existing pane/tab of an existing instance. Weirdly, wt focus-tab -w _quake starts a new non-quake window...

I found this because I was looking for a way to set a global hotkey to do "start a quake-mode terminal if it doesn't exist, or focus an existing one if there is one". I found the various issues around "make quake-mode run on startup" and that would indeed give me what I wanted without me needing to write my own hotkey. But regardless, it seems like an odd omission that I can't use the wt command to switch to an existing terminal, so I thought it was worth raising as a separate issue.

Originally created by @pfmoore on GitHub (Aug 26, 2021). ### Windows Terminal version (or Windows build number) 10.0.19042.0, 1.9.1942.0 ### Other Software N/A ### Steps to reproduce Open a "quake mode" terminal (for example, run `wt -w _quake`). At a command prompt (either the terminal you just opened, or `Win-R`) run `wt -w _quake`. ### Expected Behavior The existing quake-mode terminal gets the focus ### Actual Behavior A new quake-mode window is opened. I believe this is because the default `wt` command is `new-tab`, which creates a new tab (in quake mode, this is a new window). I would be perfectly happy with having to explicitly specify a different command - but none of the ones I've tried seem to work. I have been unable to find a wt command that switches to an existing pane/tab of an existing instance. Weirdly, `wt focus-tab -w _quake` starts a new *non-quake* window... I found this because I was looking for a way to set a global hotkey to do "start a quake-mode terminal if it doesn't exist, or focus an existing one if there is one". I found the various issues around "make quake-mode run on startup" and that would indeed give me what I wanted without me needing to write my own hotkey. But regardless, it seems like an odd omission that I can't use the wt command to switch to an existing terminal, so I thought it was worth raising as a separate issue.
claunia added the Needs-TriageNeeds-Tag-FixNeeds-Attention labels 2026-01-31 04:24:56 +00:00
Author
Owner

@DHowett commented on GitHub (Aug 26, 2021):

Hmm. If you switch the order of the arguments and try wt -w _quake focus-tab -t 0, does it work?

@DHowett commented on GitHub (Aug 26, 2021): _Hmm._ If you switch the order of the arguments and try `wt -w _quake focus-tab -t 0`, does it work?
Author
Owner

@pfmoore commented on GitHub (Aug 26, 2021):

Ah, yes it does. Thanks - I tried loads of variations that didn't work, but didn't hit on that one.

I assume the way to read the help is -w _quake is an option, and focus-tab -t 0 is the subcommand (with -t 0 being an option of the subcommand)?

Personally, I might have had more luck finding the right form if the documentation was written in more of a "reference" style, rather than being as example-focused as it currently is. Also, I don't believe there's a list of all of the subcommands anywhere, except in the examples. I realise that what works best is very personal and subjective, but is that something that could be considered?

Thanks for providing the solution, though!

@pfmoore commented on GitHub (Aug 26, 2021): Ah, yes it does. Thanks - I tried *loads* of variations that didn't work, but didn't hit on that one. I assume the way to read the help is `-w _quake` is an option, and `focus-tab -t 0` is the subcommand (with `-t 0` being an option of the subcommand)? Personally, I might have had more luck finding the right form if the documentation was written in more of a "reference" style, rather than being as example-focused as it currently is. Also, I don't believe there's a list of all of the subcommands anywhere, except in the examples. I realise that what works best is very personal and subjective, but is that something that could be considered? Thanks for providing the solution, though!
Author
Owner

@DHowett commented on GitHub (Aug 26, 2021):

That's an excellent point. Our documentation isn't comprehensive in this regard.

You're right about the arguments and subcommand ordering; -w is an option for all of wt, -t is an option for focus-tab, and we have a weird intersection where technically wt is an alias for wt new-tab, so wt looks like it accepts new-tab's options. That was a mouthful of a sentence.

Right now, the best (despite how annoying it is!) way to figure out what Terminal can do on the command line is to run wt --help, which is itself a magic flag that I suspect we haven't documented. Subcommand help is accessible via wt focus-tab --help (et al)

@DHowett commented on GitHub (Aug 26, 2021): That's an excellent point. Our documentation isn't comprehensive in this regard. You're right about the arguments and subcommand ordering; `-w` is an option for all of `wt`, `-t` is an option for `focus-tab`, and we have a weird intersection where technically `wt` is an alias for `wt new-tab`, so `wt` looks like it accepts `new-tab`'s options. That was a mouthful of a sentence. Right now, the best (despite how annoying it is!) way to figure out what Terminal can do on the command line is to run `wt --help`, which is itself a magic flag that I suspect we haven't documented. Subcommand help is accessible via `wt focus-tab --help` (et al)
Author
Owner

@pfmoore commented on GitHub (Aug 26, 2021):

I knew about wt --help, but not about using --help with the subcommands. Also, I think I'd mistakenly assumed that the list of subcommands given there was incomplete - I'm not entirely sure why I thought that, maybe I was confusing them with the actions you can use in key bindings?

Thanks again, I have everything I need now, so I'll close this.

@pfmoore commented on GitHub (Aug 26, 2021): I knew about `wt --help`, but not about using `--help` with the subcommands. Also, I think I'd mistakenly assumed that the list of subcommands given there was incomplete - I'm not entirely sure why I thought that, maybe I was confusing them with the actions you can use in key bindings? Thanks again, I have everything I need now, so I'll close this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#14979