-
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
Add support for new panes with specifc profiles and other settings overrides #3825
Conversation
…erride a profile in a newTab command
…ther vertically or horizontally
…ane-action # Conflicts: # src/cascadia/TerminalApp/AppKeyBindings.cpp # src/cascadia/TerminalApp/AppKeyBindings.h # src/cascadia/TerminalApp/AppKeyBindings.idl # src/cascadia/TerminalApp/TerminalPage.cpp
…rminal-args # Conflicts: # src/cascadia/TerminalApp/ActionArgs.idl
Move all the profile determination stuff into CascadiaSettings. Now it's in charge of building the right TerminalSettings based on the index and NewTerminalArgs passed to it. Then, also hook that up to SplitPane. This weirdly makes a new tab _and_ a new pane, which is wrong. Dunno why yet. Ill debug mondeay
…rminal-args # Conflicts: # doc/cascadia/profiles.schema.json # src/cascadia/TerminalApp/ActionArgs.h # src/cascadia/TerminalApp/ActionArgs.idl # src/cascadia/TerminalApp/AppActionHandlers.cpp # src/cascadia/TerminalApp/TerminalPage.cpp # src/cascadia/TerminalApp/TerminalPage.h
(cherry picked from commit b392ba0)
…erminal-args # Conflicts: # src/cascadia/LocalTests_TerminalApp/KeyBindingsTests.cpp # src/cascadia/LocalTests_TerminalApp/SettingsTests.cpp # src/cascadia/LocalTests_TerminalApp/TabTests.cpp # src/cascadia/LocalTests_TerminalApp/TerminalApp.LocalTests.AppxManifest.prototype.xml
…rminal-args # Conflicts: # src/cascadia/LocalTests_TerminalApp/KeyBindingsTests.cpp
Can we also have support for
Or should this be a separate issue? |
@carlos-zamora I actually secretly snuck that in with the refactor to have |
# Conflicts: # src/cascadia/TerminalApp/TerminalPage.cpp
auto actionAndArgs = winrt::make_self<winrt::TerminalApp::implementation::ActionAndArgs>(); | ||
actionAndArgs->Action(ShortcutAction::NewTab); | ||
auto newTabArgs = winrt::make_self<winrt::TerminalApp::implementation::NewTabArgs>(); | ||
newTabArgs->ProfileIndex(profileIndex); | ||
auto newTerminalArgs = winrt::make_self<winrt::TerminalApp::implementation::NewTerminalArgs>(); | ||
newTerminalArgs->ProfileIndex(profileIndex); | ||
newTabArgs->TerminalArgs(*newTerminalArgs); | ||
actionAndArgs->Args(*newTabArgs); | ||
profileKeyChord = keyBindings.GetKeyBindingForActionWithArgs(*actionAndArgs); |
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 super expensive, we'll want to maybe not have it be so expensive later.
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.
(One can file a task for this)
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 thought make_self
was the non-expensive version that just makes a com_ptr
for the class, but didn't do the binary boundary hopping
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.
no no it is, but it's still a heap alloc of like four objects for what amounts to a hash table lookup 😄
…rminal-args # Conflicts: # src/cascadia/LocalTests_TerminalApp/KeyBindingsTests.cpp
Hello @zadjii-msft! 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 (
|
## Summary of the Pull Request I accidentally did the wrong check here to see if the value exists. For an `IReference`, you need to do `variable != nullptr`. I did `variable.Value()`. ## References Introduced in #3825 ## PR Checklist * [x] Closes #3897 * [x] I work here * [ ] Tests added/passed - wow this was a lot harder than I expected * [n/a] Requires documentation to be updated ## Detailed Description of the Pull Request / Additional comments This includes a maybe unrelated fix to make `TerminalPage`'s `ShortcutActionDispatch` a `com_ptr`. While I was messing with the tests for this, I caught that we're not supposed to direct allocate winrt types like that. Ofc, the `TerminalAppLib` project doesn't catch this. ## Validation Steps Performed Ran the terminal manually, instead of just running the tests
## Summary of the Pull Request On this month's episode of "Mike accidentally breaks this": Mike forgets that `==` is defined on a pair of winrt objects as "do these point to the _SAME_ object", not "do they have the same values". This just slipped right through code review. ## References Broken in #3825 ## PR Checklist * [x] Closes #3896 * [x] I work here * [ ] Tests added/passed * [n/a] Requires documentation to be updated ## Detailed Description of the Pull Request / Additional comments ## Validation Steps Performed Manually checked that these are still there
🎉 Handy links: |
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.
👍
Summary of the Pull Request
This enables the user to set a number of extra settings in the
NewTab
andSplitPane
ShortcutAction
s, that enable customizing how a new terminal is created at runtime. The following four properties were added:profile
commandline
tabTitle
startingDirectory
profile
can be used with either a GUID or the name of a profile, and the action will launch that profile instead of the default.commandline
,tabTitle
, andstartingDirectory
can all be used to override the profile's values of those settings. This will be more useful for #607.With this PR, you can make bindings like the following:
References
This is a lot of work that was largely started in pursuit of #607. We want people to be able to override these properties straight from the commandline. While they may not make as much sense as keybindings like this, they'll make more sense as commandline arguments.
PR Checklist
Validation Steps Performed
There are tests 🎉
Manually added some bindings, they opened the correct profiles in panes/tabs