Terminal: Split Pane via a context menu

Created on 19 Mar 2020  路  7Comments  路  Source: microsoft/terminal

Description of the new feature/enhancement

If you have the dropdown open...

  • Alt click a profile to open an auto sized pane of the profile.

related to #1000

Alternative Implementations

  1. no-auto

    • Alt+Click: vertical split

    • Alt+Shift+Click: horizontal split

  2. customizable split

    • right click opens a flyout with the options "vertical", "horizontal", "auto"

    • Alt+Click/Invoke behavior is defined in your profiles.json

But why bother?

I'm a very visual person. I like to see what profiles I have before opening one, personally.

Also, I forget what each index for the new-pane key binding maps to which profile. So I constantly find myself opening a new pane, seeing that it's the wrong one, closing it, checking the drop down, figuring out the index, then trying the correct key binding. That's on me for being a very visual person, but being able to short-circuit the process into an alt+click would feel pretty natural, I think.

Proposed technical implementation details

This would be pretty easy to implement, actually. For input, we'd just look at how the Settings flyout menu is handled. Then we just call the new-pane function off of TermApp with the profile that we targeted.

If we go with the alternative implementations, the above implementation is fundamentally the same. We'd just call the function with different parameters.

Comments after #5928

5928 added the ability to split pane by alt+clicking a profile in the new tab flyout. This doesn't entirely close this issue. Though now you can open a pane without keybindings, the user should still be able to choose whether they want a horizontal or vertical pane. This issue has been promoted to track that scenario in particular.

Area-User Interface Issue-Feature Product-Terminal

Most helpful comment

For the record, I've decided on this:

  • alt+click/enter --> auto splitPane
  • right click or menu key --> open context menu with...
| Auto Split        |
| Horizontal Split  |
| Vertical Split    |
---------------------

All 7 comments

Please link this from 1000.

And yes, I love this idea.

For the record, I've decided on this:

  • alt+click/enter --> auto splitPane
  • right click or menu key --> open context menu with...
| Auto Split        |
| Horizontal Split  |
| Vertical Split    |
---------------------

Ok. I was working on this a bit more. FlyoutMenuItem has a Click event that seems to be called on any kind of invocation on the item (keyboard, mouse, touch, etc...). Creating a context menu on this would mean that we would have to break up Click into multiple event handlers (i.e. PointerPressed, KeyDown, etc...).

@DHowett-MSFT and I were thinking maybe the _cleaner_ behavior would be to create a story for how to "move" a pane's configuration around. Think of it like dragging panes in VS Code and getting a shadow for where it would go.

@zadjii-msft Thoughts?

What if we did it on the tab context menu we added in #3789?

What if we did it on the tab context menu we added in #3789?

Sorry, I don't follow. You'd right click on a tab, get the context menu, then what?

Shoot, that's what I get for trying to reply to an issue on a vacation day from email.

I'm thinking something like this, from VSCode:
image

The "split right/left/up/down" that you get when clicking on a tab. I think that's also tracked somewhere in #1912

Was this page helpful?
0 / 5 - 0 ratings