-
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 support for the newWindow
action
#9208
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.
(@ everyone - we're trying to get this in for 1.7 today, hence why you're all on the assigned-to line. Thanks |
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.
- Update schema
- Update docs
Seems to be a lot of "Just moved things around. Can revert changes to this file."
Approving since we have a tight deadline, but please make sure you update the schema (or wait... maybe it's already updated?! idk, check haha).
// else if (_ProfileIndex) | ||
// { | ||
// ss << fmt::format(L"profile index: {}, ", _ProfileIndex.Value()); | ||
// } |
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.
So remove the dead code for index?
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 think this is valuable to keep.
@@ -13,7 +13,6 @@ namespace Microsoft.Terminal.Settings.Model | |||
OpenNewTabDropdown, | |||
DuplicateTab, | |||
NewTab, | |||
NewWindow, |
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.
Looks like you just moved around these enums. Could probably revert changes here.
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.
FYI I intentionally moved them all to be at the end so that the order was more consistent, and reflective of the order these things were added in. NewWindow
already existing in the list was maybe an oversight? I suppose I reserved the key long before it ever was used?
@@ -150,6 +150,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation | |||
{ ShortcutAction::MoveTab, MoveTabArgs::FromJson }, | |||
{ ShortcutAction::ToggleCommandPalette, ToggleCommandPaletteArgs::FromJson }, | |||
{ ShortcutAction::FindMatch, FindMatchArgs::FromJson }, | |||
{ ShortcutAction::NewWindow, NewWindowArgs::FromJson }, |
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 line seems to be the only relevant change in this file. All of the other ones are just moving stuff around.
@@ -53,5 +52,6 @@ namespace TerminalApp | |||
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, Microsoft.Terminal.Settings.Model.ActionEventArgs> BreakIntoDebugger; | |||
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, Microsoft.Terminal.Settings.Model.ActionEventArgs> FindMatch; | |||
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, Microsoft.Terminal.Settings.Model.ActionEventArgs> TogglePaneReadOnly; | |||
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, Microsoft.Terminal.Settings.Model.ActionEventArgs> NewWindow; |
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.
Just moved stuff around. Could revert changes to this file
@@ -67,6 +66,7 @@ namespace winrt::TerminalApp::implementation | |||
TYPED_EVENT(BreakIntoDebugger, TerminalApp::ShortcutActionDispatch, Microsoft::Terminal::Settings::Model::ActionEventArgs); | |||
TYPED_EVENT(FindMatch, TerminalApp::ShortcutActionDispatch, Microsoft::Terminal::Settings::Model::ActionEventArgs); | |||
TYPED_EVENT(TogglePaneReadOnly, TerminalApp::ShortcutActionDispatch, Microsoft::Terminal::Settings::Model::ActionEventArgs); | |||
TYPED_EVENT(NewWindow, TerminalApp::ShortcutActionDispatch, Microsoft::Terminal::Settings::Model::ActionEventArgs); |
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.
Just moved things around. Can revert changes to this file.
@@ -266,6 +260,11 @@ namespace winrt::TerminalApp::implementation | |||
_TogglePaneReadOnlyHandlers(*this, eventArgs); | |||
break; | |||
} | |||
case ShortcutAction::NewWindow: |
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.
Just moved things around. Can revert changes to this file.
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.
The only thing I am blocking on is that header filled with bare functions. They have to be _TIL_INLINEPREFIX
or put into a cpp that is compiled and linked into WinRTUtils, or made safe in some other way.
// else if (_ProfileIndex) | ||
// { | ||
// ss << fmt::format(L"profile index: {}, ", _ProfileIndex.Value()); | ||
// } |
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 think this is valuable to keep.
|
||
if (!_Commandline.empty()) | ||
{ | ||
ss << fmt::format(L"-- \"{}\" ", _Commandline); |
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 think there's a better way to do this (using format_to), but i am not blocking on it
// - <none> | ||
// Return Value: | ||
// - true if we believe this extension is being run in the dev build package. | ||
bool IsDevBuild() |
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.
we can't do this. Including bare functions in a header is a way to get hurt during linking if two files in the same project #include
it.
// This will get us the correct exe for dev/preview/release. If you | ||
// don't stick this in a local, it'll get mangled by ShellExecute. I | ||
// have no idea why. | ||
const auto exePath{ GetWtExePath() }; |
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 only works for CascadiaPackage and not WTU
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 we were doing this to the gills we would propagate the event out of AppLogic and to the win32 host so the win32 host could spawn another copy of itself
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 not a blocking comment!
newTerminalArgs = NewTerminalArgs(); | ||
} | ||
|
||
auto [profileGuid, settings] = TerminalSettings::BuildSettings(_settings, |
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.
BIG HAMMER to get a guid from an args
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.
(not blocking)
it's now _after_ 5pm on a friday so I'm not doing the rest
Hello @DHowett! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
🎉 Handy links: |
Finally implements the
newWindow
action. It does so byShellExecute
ingwt.exe
with commandline args corresponding to theones that would create the same
NewTerminalArgs
. This works with #8898and #9118 to allow new windows (even with
windowingBehavior: useExisting
)This is taken from my auto-elevate branch, hence the references to
elevation
References #5000
References projects/5
References #8898
References #9118
Closes #1051