-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Add globalSummon
action
#9854
Add globalSummon
action
#9854
Conversation
…ompile a String[]
…!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
…safely tear it down. It _seems_ like it.
…ndow should be. It just always says 0 for now, but in the future it could actually give us useful info.
(cherry picked from commit 9f9eacb)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving. Only thing is to create a better localized text when a name is provided.
Hoping this can merge in soon so I can propagate any necessary changes to my ActionMap
PR #9621
// "Summon the Terminal window, name:\"{_Name}\"" | ||
if (!_Name.empty()) | ||
{ | ||
ss << L", name: "; | ||
ss << std::wstring_view(_Name); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we've gotten away with it before, but "name" isn't really localized. How about Summon the "<Name>" window
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just gonna punt this discussion to the next PR I've got queued up, because it's gonna become a quagmire of
Summon the Terminal window named "Foo" to the current desktop
(toCurrent/toCurrent/"Foo")Summon the Terminal window on the current desktop
(onCurrent/toCurrent)Summon the Terminal window
(toCurrent/toCurrent)Go to the Terminal window
(any/toCurrent)Summon the Terminal window named "Foo" to the current desktop, to the current monitor
Summon the Terminal window on the current desktop, to the current monitor
Summon the Terminal window on the current desktop, on the current monitor
Summon the Terminal window on the current monitor, to the current desktop
(this one had to change order in English to make sense)
y i k e s
Format the code -- DO NOT AUTOMERGE as it will destroy the open branches with stacked PRs. |
can do. Once #9954 is approved, I could just merge top-down lol |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commenting now to see all my comments in one place to decide whether to request/approve.
@@ -71,6 +71,8 @@ namespace TerminalApp | |||
|
|||
FindTargetWindowResult FindTargetWindow(String[] args); | |||
|
|||
Windows.Foundation.Collections.IMap<Microsoft.Terminal.Control.KeyChord, Microsoft.Terminal.Settings.Model.ActionAndArgs> GlobalHotkeys(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically a View
|
||
for (const auto& [k, v] : _keyShortcuts) | ||
{ | ||
if (v.Action() == ShortcutAction::GlobalSummon) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
discussion hook: This is crying out for Actions to have Scopes 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if only there was hours in the day to even imagine spec'ing that idea 😋
<!-- | ||
Microsoft ResX Schema | ||
|
||
<!-- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-save this file in VS if you edited it with SUBL
else | ||
{ | ||
// We should make the window ourselves. | ||
_createNewTerminalWindow(summonArgs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worried about the proliferation of blocks of "run wt.exe with these args" code...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is clever/cool though
Okay, my only NAK comment is the postprocessing one. If it's justifiable, I'm okay with it ... but it does put some smarts in the reader rather than the loader. |
🎉 Handy links: |
Summary of the Pull Request
Adds support for two new actions:
globalSummon
, which can be used to activate a window using a global (READ: OS-level) hotkey.name
argument. When provided, this will attempt to summon with the given name. When omitted, we'll try to summon the most recent window.quakeMode
which isglobalSummon
for the_quake
window.These actions are stored in the actions array, but are read by the
WindowsTerminal
level and bound to the OS inIslandWindow
. The monarch registers for these keybindings with the OS. When one is pressed, the monarch will recieve aWM_HOTKEY
message. It'll use that to look up the corresponding action args. It'll use those to try and simmon the right window.References
_quake
special #9785: The start of granting "_quake" super powersPR Checklist
Detailed Description of the Pull Request / Additional comments
I'd love to post screenshots and gifs of this all over twitter, but hey that's frowned upon
Validation Steps Performed
win
keyswin
keysglobalSummon
andquakeMode
at the same time and do different thingsglobalSummon
with a name and it creates that name if it doesn't already exist