Skip to content
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 ability to change split order #1525

Open
janpeterd opened this issue Feb 15, 2024 · 4 comments
Open

Add ability to change split order #1525

janpeterd opened this issue Feb 15, 2024 · 4 comments
Labels
gui GUI or app issue regardless of platform (i.e. Swift, GTK)

Comments

@janpeterd
Copy link
Collaborator

I think an action that can change the order of splits would be a great feature. Currently there is no way to change the order of splits after creating them.

Kitty has something like this called move window.

@mitchellh mitchellh added the core label Feb 15, 2024
@mitchellh mitchellh added gui GUI or app issue regardless of platform (i.e. Swift, GTK) and removed enhancement labels Oct 2, 2024
@rafikdraoui
Copy link
Member

Another potential inspiration for such a feature would be Vim. It has default key bindings for:

  1. "Rotating" splits (i.e changing the order of the splits while preserving the layout)
  2. Moving a split to the right/left/top/bottom of the window
  3. Moving a split to a new tab

(c.f. https://neovim.io/doc/user/windows.html#_5.-moving-windows-around)

@ilyagr
Copy link

ilyagr commented Dec 27, 2024

Adding to the list from the previous comment, you'd also want to be able to turn a tab into a split (inside another tab).

Apart from a command for each of these, kitty has a command that asks the user where they want to move the current split (pane in Kitty-split) to. It doesn't have a default binding (which I think is unfortunate), but is configured as:

map kitty_mod+1  detach_window ask

Here's a picture:

Image

There is no option to make a new tab in another window, but this can be achieved by first moving the pane into a tab in that window, and then using a command again to move it into a new tab (in that same window).

tmux join-pane is similar, though I'm not sure it has a nice UI.

(I'm not sure at what point these features should be split into separate discussions and bugs, but it feels right to also have a list of them all in one place and I haven't found a better place)

@SenseiMarv
Copy link

To add a bit of context and third-party examples: Here is the GUI solution that iTerm2 has for this in a discussion that I started, which would also play into this: #3747

@H-M-H
Copy link

H-M-H commented Dec 29, 2024

As vim has already been mentioned, it differentiates between buffer, window and tab page:

Summary:
A buffer is the in-memory text of a file.
A window is a viewport on a buffer.
A tab page is a collection of windows.

I thinks this maps neatly to pty, pane and tab page. If attaching and detaching a pty from a pane is possible, it's also easy to move a pty between tabs or even display it in multiple tabs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gui GUI or app issue regardless of platform (i.e. Swift, GTK)
Projects
None yet
Development

No branches or pull requests

6 participants