-
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
Support for navigating panes by MRU #8183
Conversation
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.
A few other things:
- Don't forget to update the docs/schema
- what happens if we provide "next" or "previous" to "resizePane"?
The |
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
_Resize()
function will return false and nothing happens. I've noted in the docs that the direction given toresize
cannot be next or previous. If people feel strongly about it we can make them two distinct direction enums?
A few issues here:
- Generally, when you put an invalid value for the arg in the json, we display a warning.
- When you say "nothing happens" does it eat the keybinding or does the keybinding still get sent to the buffer (i.e.
^A
)? - Right now, we have enum mappers exposing enums to the Settings UI. Though keybindings aren't there yet, we'll probably use this the same way. If we have a single enum mapper for
Direction
, we'll have to figure out how to exclude "next" and "previous" in one keybinding arg, but not the other.
I'd rather you split the enum into 2 different ones in the schema and the code. It just acts more properly that way and it's more future-proof.
Fair enough, its split now! |
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.
Thank you. You could keep the ResizeDirection
as just plain Direction
if you wanted to reduce the diff. But I'm fine either way.
Okay my immediate thoughts are around how we expose this action to the user. We're already running into similar struggles with For reference, there's also discussion in #8025 that might be helpful. So, with next/prev MRU switching, without some sort of dialog, those will just toggle between the last two used panes. If there's a fourth pane, that pane will be inaccessible with next/prev pane. Also, having panes in the ATS is something we might want some day, with something like:
whatever, you get it. Plus, do we want to enable in-order next/prev traversal? Once we have pane IDs, then presumably, yea. Do we want to overload // Focus pane 1
// - This is sensible, no arguments here
{ command": { "action": "focusPane", "id": 1 } },
// Focus the next in order pane, don't use the switcher
// - We'd have to ensure that an id and order aren't passed at the same time, and that might be unintuitive
// - How do we specify next/prev? "direction" seems wrong, but maybe we keep the
// FocusDirection(up|down|left|right|next|prev) enum and have one focus action
// to rule them all
{ command": { "action": "focusPane", "order": "inOrder", useSwitcher": false } },
// Focus the next MRU pane
// - Withough the switcher, this can only go one pane deep in the MRU stack
// - presumably once there's a pane switcher, it would default to enabled?
{ command": { "action": "focusNextPane", "order": "mru" } },
// Focus the prev inOrder pane
// - this seems straightforward
{ command": { "action": "focusPrevPane", "order": "inOrder" } },
// Focus the next pane, in mru order, explicitly disable the switcher
// - The user opted in to only being able to MRU switch one deep. That's fine, that's what they want.
{ command": { "action": "focusNextPane", "order": "mru", "useSwitcher": false} },
// Focus the prev inOrder pane, explicitly with the switcher
// - Maybe they disabled the switcher globally, but what it on for this action?
{ command": { "action": "focusPrevPane", "order": "inOrder", "useSwitcher": true } }, Thoughts? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@msftbot make sure @zadjii-msft signs off on this |
Hello @zadjii-msft! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
I like the idea of having separate commands for
I am not sure about this, we will need a way for the user to know the pane IDs and that may not always be feasible - paging @DHowett for thoughts on this |
@zadjii-msft @PankajBhojwani Could we create a spec for this and discuss the design in a brownbag? There seems to be a lot of options here. And I'd like to make sure the design interacts well with the current ATS customization model. Especially given our recent experience with ATS MRU. |
I don’t think this requires a spec. An informal chat should do! |
Is |
Hello @zadjii-msft! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
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 I follow all this, and it looks good to me. I'm telling the bot to wait until EOD Friday to merge this, to give Dustin one last chance, but I think this is fine
src/cascadia/TerminalSettingsModel/Resources/en-US/Resources.resw
Outdated
Show resolved
Hide resolved
pair_type{ "left", ValueType::Left }, | ||
pair_type{ "right", ValueType::Right }, | ||
pair_type{ "up", ValueType::Up }, | ||
pair_type{ "down", ValueType::Down }, | ||
pair_type{ "previous", ValueType::Previous }, |
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.
wait did we want the setting to be previous
or prev
? It's prevTab
and nextTab
now,
But you know what I'm totally okay with this.
src/cascadia/TerminalSettingsModel/Resources/en-US/Resources.resw
Outdated
Show resolved
Hide resolved
src/cascadia/TerminalSettingsModel/TerminalSettingsSerializationHelpers.h
Outdated
Show resolved
Hide resolved
Hit this with a code format! |
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 (
|
## Summary of the Pull Request This is a spec for "pane navigation", as we've already got a bit of an implementation in #8183. We've also had a heated discussion in Teams, and I wanted to capture a bit of that in a more formal doc. I suppose that "informal Teams chat" didn't work out in the end 😆. Also, this is @PankajBhojwani's feature so I'm gonna let him drive. I mostly wrote this to test out a new spec template. After discussion, we landed on proposal D, with a minor change of `last` to `prev`. This is how it was in #8183 before I started meddling 😝 ## PR Checklist * [x] spec for #2871 * [x] I work here ## Detailed Description of the Pull Request / Additional comments This is not my best spec ever - again, mostly just trying to spawn discussion, and prototype the new spec template.
## Summary of the Pull Request Adds support for the `move-focus` subcommand to `wt.exe`. This subcommand works _exactly_ like `moveFocus(up|down|left|right)`. ## References * Will surely conflict with #8183 * Is goodness even in the world where #5464 exists ## PR Checklist * [x] Closes #6580 * [x] I work here * [x] Tests added/passed * [x] Docs PR: MicrosoftDocs/terminal#209 ## Detailed Description of the Pull Request / Additional comments Bear with me, I wrote this before paternity leave, so code might be a bit stale. Oddly, after startup, this _does not_ leave the focus on the pane you moved to. If you `move-focus` during startup, at the end of startup, we'll still focus a _random_ pane. This is because the terminal still auto-focus a TermControl when it's done with layout. While we'll maintain the active control just fine during the startup, at the end of startup, all the controls will complete layout in a random order. This is no different than the startup right now. `wt sp ; sp ; sp` will focus a random pane at the end. This is left for a future someone to fix This is also subject to #2398 / #4692. Moving in a direction isn't _totally_ reliable currently. `focus-pane -t ID` will certainly be more reliable, but this will work in the meantime? ## Validation Steps Performed Opened probably 100 terminals, confirmed that the layout was always correct. Final focused pane was random, but the layout was right.
Adds a "move to previous pane" and "move to next pane" keybinding, which navigates to the last/first focused pane We assign pane IDs on creation and maintain a vector of active pane IDs in MRU order. Navigating panes by MRU then requires specifying which pane ID we want to focus. From our offline discussion (thanks @zadjii-msft for the concise description): > For the record, the full spec I'm imagining is: > > { command": { "action": "focus(Next|Prev)Pane", "order": "inOrder"|"mru", "useSwitcher": true|false } }, > > and order defaults to mru, and useSwitcher will default to true, when > there is a switcher. So > > { command": { "action": "focusNextPane" } }, > { command": { "action": "focusNextPane", "order": "mru" } }, > > these are the same action. (but right now we don't support the order > param) > > Then there'll be another PR for "focusPane(target=id)" > > Then a third PR for "focus(Next|Prev)Pane(order=inOrder)" > for the record, I prefer this approach over the "one action to rule > them all" version with both target and order/direction as params, > because I don't like the confusion of what happens if there's both > target and order/direction provided. References microsoft#1000 Closes microsoft#2871
## Summary of the Pull Request This is a spec for "pane navigation", as we've already got a bit of an implementation in microsoft#8183. We've also had a heated discussion in Teams, and I wanted to capture a bit of that in a more formal doc. I suppose that "informal Teams chat" didn't work out in the end 😆. Also, this is @PankajBhojwani's feature so I'm gonna let him drive. I mostly wrote this to test out a new spec template. After discussion, we landed on proposal D, with a minor change of `last` to `prev`. This is how it was in microsoft#8183 before I started meddling 😝 ## PR Checklist * [x] spec for microsoft#2871 * [x] I work here ## Detailed Description of the Pull Request / Additional comments This is not my best spec ever - again, mostly just trying to spawn discussion, and prototype the new spec template.
## Summary of the Pull Request Adds support for the `move-focus` subcommand to `wt.exe`. This subcommand works _exactly_ like `moveFocus(up|down|left|right)`. ## References * Will surely conflict with microsoft#8183 * Is goodness even in the world where microsoft#5464 exists ## PR Checklist * [x] Closes microsoft#6580 * [x] I work here * [x] Tests added/passed * [x] Docs PR: MicrosoftDocs/terminal#209 ## Detailed Description of the Pull Request / Additional comments Bear with me, I wrote this before paternity leave, so code might be a bit stale. Oddly, after startup, this _does not_ leave the focus on the pane you moved to. If you `move-focus` during startup, at the end of startup, we'll still focus a _random_ pane. This is because the terminal still auto-focus a TermControl when it's done with layout. While we'll maintain the active control just fine during the startup, at the end of startup, all the controls will complete layout in a random order. This is no different than the startup right now. `wt sp ; sp ; sp` will focus a random pane at the end. This is left for a future someone to fix This is also subject to microsoft#2398 / microsoft#4692. Moving in a direction isn't _totally_ reliable currently. `focus-pane -t ID` will certainly be more reliable, but this will work in the meantime? ## Validation Steps Performed Opened probably 100 terminals, confirmed that the layout was always correct. Final focused pane was random, but the layout was right.
Adds a "move to previous pane" and "move to next pane" keybinding, which
navigates to the last/first focused pane
We assign pane IDs on creation and maintain a vector of active pane IDs
in MRU order. Navigating panes by MRU then requires specifying which
pane ID we want to focus.
From our offline discussion (thanks @zadjii-msft for the concise
description):
References #1000
Closes #2871