microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.82k stars 8.33k forks source link

Swap panes #4922

Open kostrse opened 4 years ago

kostrse commented 4 years ago

Right now, after splitting my screen onto two panes, I cannot find a way to swap the panes between each other.

In tmux it's possible to move/swap opened panes in different ways.

Moving panes around in tmux:

C-a {          move the current pane to the previous position
C-a }          move the current pane to the next position
C-a C-o        rotate window ‘up’ (i.e. move all panes)
C-a M-o        rotate window ‘down’
C-a !          move the current pane into a new separate
               window (‘break pane’)
C-a :move-pane -t :3.2
               split window 3's pane 2 and move the current pane there

Related tmux commands:

zadjii-msft commented 4 years ago

This is fairly similar to another request that's already being tracked in #1000

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)

but this is unique enough that I'll leave it open to track independently. Thanks!

DHowett-MSFT commented 4 years ago

Yanking triage off this one

zadjii-msft commented 3 years ago

With #10638 merged, I'm gonna leave this open to track implementing the swapPane(from={id}, to={it}) action. I'm gonna pop the rotatePanes action into it's own separate issue for tracking purposes.

Rosefield commented 3 years ago

To note, there is now a Pane::SwapPanes function , so all that needs to be done for swap-pane(from{id}, to={id}) is adding the boilerplate for the command and actually calling SwapPanes.

zadjii-msft commented 2 years ago

Oh hey look, this was added in #10780!

Rosefield commented 2 years ago

With #10638 merged, I'm gonna leave this open to track implementing the swapPane(from={id}, to={it}) action. I'm gonna pop the rotatePanes action into it's own separate issue for tracking purposes.

I'm fairly certain that I did not implement this specifically, at least it isn't user accessible, see my comment above. While SwapPanes lets you do all kinds of things, the UI doesn't let you swap 2 arbitrary panes by their IDs.

zadjii-msft commented 2 years ago

That's what I get for not reading and getting high on closing out issues 😜