Terminal: Scenario: Add support for panes

Created on 24 May 2019  ·  48Comments  ·  Source: microsoft/terminal

image

This is the megathread for tracking all the remaining work that needs to be done to get panes ready.

1.0 Features

  • [x] Original issue: #532 -> added in #825
  • [x] #991 Panes should be resizable with the keyboard. (fixed PR #1207)
  • [x] #995 The user should be able to navigate the focus of panes with the keyboard, instead of requiring the mouse. (PR #1910)
  • [x] #993 There's no keyboard shortcut for "ClosePane"
  • [x] #998 Open panes with a specific profile
  • [x] #994 There should be some sort of UI to indicate that a particular pane is focused, more than just the blinking cursor. tmux accomplishes this by colorizing the separators adjacent to the active pane. Another idea is displaying a small outline around the focused pane (like when tabbing through controls on a webpage). (PR:#3060)
  • [x] #999 If you click on the separator's between panes, then no panes will be focused (PR #3540)
  • [x] #3045 Moving focus between panes doesn't always work (PR #3958)
  • [x] #3544 Add a default keybinding for panes, to enable them by default. (PR #3585)
  • [x] #2834 Snap to character grid when resizing window (PR #3181)
  • [x] #3960 Automatic splits similar to tiling window managers

1.x features / bugs

  • [x] #1756 The user should be able to configure what profile is used for splitting a pane. Currently, the default profile is used, but it's possible a user might want to create a new pane with the parent pane's profile.
  • [ ] #992 Panes should be resizable with the mouse. The user should be able to drag the separator for a pair of panes, and have the content between them resize as the separator moves.
  • [ ] #4692 Pane focus movement doesn't remember where it came from

2.0 Features / Bugs

  • [ ] #2398 Move focus to the visually adjacent pane, not just the first pane on the other side of the separator.
  • [ ] #3062 Add a configuration object for focused vs unfocused state
  • [x] #996 The user should be able to zoom a pane, to make the pane take the entire size of the terminal window temporarily.
  • [ ] #3586 Open a new pane by prompting the user for which profile to use
  • [ ] #5803 moveFocus to pane using number (See also #5464)
  • [ ] #3917 Panel split background ignores requestedTheme, follows system app mode

Panes Titlebar Follow-ups - See #4998

  • [ ] #7075 Allow moving panes to other tabs
  • [ ] Panes should have editable titles #7290

Backlog items

  • [ ] The user should be able to tear-off tabs and dock them as a split (See this comment)

    • [ ] #4587 Drag & Drop Tabs to create a Pane

  • [ ] #997 A pane doesn't necessarily need to host a terminal. It could potentially host another UIElement. One could imagine enabling a user to quickly open up a Browser pane to search for a particular string without needing to leave the terminal. (spec #1080)
  • [ ] #3061 Add a setting to manually set the Pane highlight color (PR #3752)
  • [ ] #3063 Add a setting to manually set the Pane border width
  • [x] #1001 Panes should have an optional motion effect on entrance
  • [ ] #3656 Add support for tmux Control Mode
  • [ ] #2634 Support broadcast input
  • [ ] #3708 Add option for more subtle pane focus border
  • [ ] #4259 Open a new pane with the environment vars of the parent
  • [ ] #2871 Add nextPane and prevPane keybindings (in PR #8183)
  • [ ] #4340 Choose Direction to Split Pane
  • [ ] A switch panes option? Like a switchLeft, switchRight, switchUp, switchDown, to allow the user to rearrange the panes layout (https://github.com/microsoft/terminal/issues/1000#issuecomment-578665067)
  • [ ] #4922 Swap panes
  • [ ] #4941 Please add support closePaneRight/Left/Up/Down
  • [ ] #5025 Open panes without keybindings
  • [ ] #6002 Split panes equally in size
  • [ ] #6219 Pass through moveFocus keys when the user has no panes
  • [ ] #6459 Pane focus follows mouse
  • [ ] Moving focus with a zoomed pane should just zoom the adjacent pane #7215
  • [ ] Add a fluent animation for pane zooming #7216
  • [ ] Pane opening animation should not flash the default pane backdrop #7365
  • [x] Panes should have an animation when they're closed, too #7366
  • [ ] Use a Clip rect for Pane animations instead of the Width/Height #7436
Area-User Interface Issue-Scenario Product-Terminal

Most helpful comment

08 May 2020 EDIT - This is no longer up-to-date, see below


Old message content

@ksawerykarwacki this is the blob I use for my pane settings typically:

            { "keys": ["alt+shift+-"], "command": "splitHorizontal" },
            { "keys": ["alt+shift+plus"], "command": "splitVertical" },

            { "keys": ["alt+shift+left"], "command": "resizePaneLeft" },
            { "keys": ["alt+shift+right"], "command": "resizePaneRight" },
            { "keys": ["alt+shift+up"], "command": "resizePaneUp" },
            { "keys": ["alt+shift+down"], "command": "resizePaneDown" },

            { "keys": ["alt+left"], "command": "moveFocusLeft" },
            { "keys": ["alt+right"], "command": "moveFocusRight" },
            { "keys": ["alt+up"], "command": "moveFocusUp" },
            { "keys": ["alt+down"], "command": "moveFocusDown" },

            { "keys": ["ctrl+shift+w"], "command": "closePane" },

The above keybindings were deprecated in 0.11. The new syntax for these can be found in the default settings for the Terminal:
https://github.com/microsoft/terminal/blob/28dc8196ab38328fa5466d24ebfb339d87d191a5/src/cascadia/TerminalApp/defaults.json#L307-L318

All 48 comments

We didn't commit the keybinding constants in with which people _could_ opt. ☹️

I noticed that @zadjii-msft added the keybindings for panes back. I'm assuming it made it into 0.1.1621.0?

If I add this block:
{ "command" : "splitHorizontal", "keys" : [ "ctrl+shift+-" ] }, { "command" : "splitVertical", "keys" : [ "ctrl+shift+|" ] },
Only Horizontal works. I noticed that if I close Windows Terminal it deletes the splitVertical keybinding from profiles.json.

@decriptor I believe that's because '|' isn't actually a key we support in the keybindings quite yet - see #1212

@zadjii-msft I believe you are right. I used ctrl+1 as a test and it didn't remove it.

I know you _really_ want it, @zadjii-msft but you have #998 on your list twice ;-)

@jaykul good catch, those are supposed to be separate issues.

@zadjii-msft and @Jaykul - just let me know where to send the care packages (hoppy beverages / candy / beef jerky / etc) 😆

Cannot wait for panes to be implemented!

Any chance of getting "focus follows mouse" like in iterm2 and other terminals? So if this setting is turned on, the active pane would be the pane you have your mouse pointer over, without having to click it first.

I know you guys are hard at work on this, literally the only thing keeping it from being a full-time tool for me.

My request is that you look at this product for inspiration for split panes:

https://gnunn1.github.io/tilix-web/

After trying so many terminals, I feel like this is the one software that truly gets panes done the right way.

I am presently running this under WSL+Xming as a work around for the lack of decent split pane terminals under Windows.

>

https://gnunn1.github.io/tilix-web/

After trying so many terminals, I feel like this is the one software that truly gets panes done the right way.

What's the difference with Terminator? This paned-terminal worked the best for everything I did; usually in a 4 pane setup! Awesome when developing!

@phalox the keybindings in Tilix are pretty awesome and it's a very polished GTK 3 app. If you like Terminator there's a chance you'll love Tilix ;-)

What's the difference with Terminator? This paned-terminal worked the best for everything I did; usually in a 4 pane setup! Awesome when developing!

I actually loved Terminator for the longest time and found Tilix during the Unity -> Gnome transition with Ubuntu. Terminator isn't seeing a lot of development these days and a number of bugs haven't been fixed. Like @LukeCarrier said, Tilix is just way more polished and has some neat features like the easy of keybindings and of multi-tab input and more advanced tab grouping.

I think both Tilix and Terminator are suitable for this project to use as a basis for how panes should work.

Last RN states that there are two new keybindings resizePane{Up,Down,Left,Right} & moveFocus{Up,Down,Left,Right} is there any sample how this configuration should look like? I cannot write any valid json to handle that.

08 May 2020 EDIT - This is no longer up-to-date, see below


Old message content

@ksawerykarwacki this is the blob I use for my pane settings typically:

            { "keys": ["alt+shift+-"], "command": "splitHorizontal" },
            { "keys": ["alt+shift+plus"], "command": "splitVertical" },

            { "keys": ["alt+shift+left"], "command": "resizePaneLeft" },
            { "keys": ["alt+shift+right"], "command": "resizePaneRight" },
            { "keys": ["alt+shift+up"], "command": "resizePaneUp" },
            { "keys": ["alt+shift+down"], "command": "resizePaneDown" },

            { "keys": ["alt+left"], "command": "moveFocusLeft" },
            { "keys": ["alt+right"], "command": "moveFocusRight" },
            { "keys": ["alt+up"], "command": "moveFocusUp" },
            { "keys": ["alt+down"], "command": "moveFocusDown" },

            { "keys": ["ctrl+shift+w"], "command": "closePane" },

The above keybindings were deprecated in 0.11. The new syntax for these can be found in the default settings for the Terminal:
https://github.com/microsoft/terminal/blob/28dc8196ab38328fa5466d24ebfb339d87d191a5/src/cascadia/TerminalApp/defaults.json#L307-L318

What about the feature of dynamically resizing a pane to displayed contents when double clicking it's right separator? Similar to snapping to contents when double clicking column separators in Excel. Many other UIs have this affordance.

FWIW, I think #756 is pretty important to calling pane support "done". I've been using ConEmu up until now, and it's nice how it opens up with my console panes pre-split and sized the way I like, and with the correct profiles loaded.

I think that this is not the main feature, since soon it will not need to be implemented inside the ...

Very much disagree because tmux isn't a user friendly, modern UI experience. Tmux and similar tools (like Byobu) are great for remote panes/tabs but it's not a great mouse/desktop experience. The best Linux terminals and terminals competing for usage on Windows are implementing split panes.

Also, I am testing split panes now with the latest Windows store build and the feature working amazingly well. Key binds are splitVertical and splitHorizontal for those looking to test as well.

This is awesome!! didn't know it worked. works flawlessly

What I need is a way to open a bunch of scripts into panes from an external shortcut (4 webpacks in a single terminal with 4 panes automatically). Is there a way to do that?

Thanks @zadjii-msft ! you deserve the AwesomeDudePrize :)

First of all, thanks for all of your work about panes.

I don't have a feature request but it took a while for me to find this issue, so there should be some information on PowerShell docs about these features, or at least some links here with the command tags. Maybe adding to the first entry here something like "Add docs"?

@mucahityilmaz thanks for the request! Panes are _intentionally_ underdocumented because they’re not yet finished.

(And I believe docs will come in with “enable a key binding for them by default”) :smile:

In #532, from @zadjii-msft:

I did not know that Tmux Control Mode even existed. That sounds really awesome, I'm totally on board with trying to make that work somehow.

Was there any further thought put into this? I love tmux control mode - it's literally the only thing keeping me tethered to MacOS at work (since only iTerm supports it, and iTerm is mac-only). If it were implemented, I'd trash my Mac and request a Windows laptop immediately.

I'd love to see it listed as a post-1.0 milestone :)

@matt-kempster You're right, we _should_ have a tmux control mode task. Thanks for keeping me honest :)

I am sure this is on the radar, but the panes aren't mouse/keyboard re-sizable right now (unless there's a hidden tmux like keybinding I just don't know about). I'd like to be able to drag on the splitters like Terminator or Tilix.

@jwhipp

  • [x] #991 Panes should be resizable with the keyboard. (fixed PR #1207)
  • [ ] #992 Panes should be resizable with the mouse. The user should be able to drag the separator for a pair of panes, and have the content between them resize as the separator moves.

Just a question, there's no way to open/close a pane with a mouse action?

For example, as in iTerm2, a right-click that opens a context menu where a user could select "Split pane Vertically" or "Split pane Horizzontaly".

Don't know if this was already tracked or discussed since it wasn't clear from the todo list so forgive me if this is a duplicate question : )

@gabrieledarrigo I believe you're correct, we don't really have a issue tracking specifically that request currently. It's definitely something we'd like, but probably as a part of #3337/#1912. Those are the issues tracking adding a context menu to various parts of the UI, and I think that adding splits to that menu will certainly be part of that design.

What about running each pane in a different user context (aka runas)? Is that possible already / is that tracked somewhere?

I don't think that's possible for the Terminal to support directly, though I'd assume that you could just set the commandline to runas /user:<whatever> pwsh.exe (or whatever runas commandline you want). With #3825 you can even specify a manual commandline for spitPane that would override the profile's commandline, like so:

{ "keys": ["ctrl+f"], "command": { "action": "splitPane", "split": "horizontal", "profile": "profile1", "commandline": "foo.exe" } },

Hi @zadjii-msft, I tested that scenario (calling runas.exe), but that spawns the new shell window (pwsh, but also tested with cmd) outside of terminal (as in, a new window similar what you would get if you would just launch cmd or pwsh outside of terminal).

How about a switch panes option?
Like a switchLeft, switchRight, switchUp, switchDown,
To allow the user to rearrange the panes layout

Does the splitPane command have option to split to same profile as current one, instead of specific profile?

How do I close a pane after creating one using alt+shift++ or alt+shift+-?

How do I close a pane after creating one using alt+shift++ or alt+shift+-?

with that default command below.

{ "command": "closePane", "keys": [ "ctrl+shift+w" ] },

Does the splitPane command have option to split to same profile as current one, instead of specific profile?

@Luke87pl That's being tracked by "Allow the user's "open pane" bindings to open a pane with the current pane" #1756

Can I have a profile that always opens as a split pane? Something like:

{
    "name": "Profile3",
    "commandline": "wt -p \"Profile1\" ; split-pane -H -p \"Profile2\""
}

(Which currently opens a new instance of Windows Terminal)

Regarding the visual indication of which pane is active, I'd love to see the inactive pane(s) dimmed the way it's done in iTerm2.

any reason why moving left / right between panes doesn't respect current row?

All the time I have panes aligned in a square, and I want to go from bottom left to bottom right. Using the keybinding for moveFocusRight puts me in the TOP right pane

@stweedie, is this what you are looking for?

#2398

that is what I was looking for, thanks

I wrote a startup script which chains multiple split-pane commands, but it always splits one of the results of the last split:

grafik

Can I convice wt somehow to also split the left or top right pane? As you can see the resulting segmentation is neither ideal, nor what all users want.

If not, is there a feature request for that?

@Trolldemorted as is mentioned in the OP:

4340 Choose Direction to Split Pane

4340 would allow me to specify whether I want to split the right or left pane, but not to split both, right?

Ah yes. What about #3759?

Depending how they solve it it might partially cover that, but it won't cover the "commit a batch script in your repository which starts wt in a grid layout" use case, correct? Every user would have to create a profile manually, or we'd have to touch the users' profiles in our batch script.

So, #4340 "Choose Direction to Split Pane" might be helpful yes, but then you'll still get stuck splitting panes down just one branch of the tree.

What you really want is probably #6580, which will let you move-focus in the commandline, so you'll be able to navigate to other panes and split those.

Also maybe helpful in the future:

  • #5803 moveFocus to pane using number (See also #5464)

    • again, only useful once there's a move-focus command

2871 Add nextPane and prevPane keybindings

- Same deal, you'd need `nextPane` & `prevPane` to be exposed as subcommands, not just actions

Thanks @zadjii-msft ! Let's hope #6580 will make it to the roadmap soon.

Can I specify an initial command for the shells somehow? Right now I am using -d . powershell.exe -NoExit -Command someshellcommand, but I am unable to rerun that command with arrow up + enter (it doesn't show up, only old commands from old shells are showing). Tried to do it with add-history, but without success.

Was this page helpful?
0 / 5 - 0 ratings