Skip to content

macOS: Split drag move - #10090

Merged
mitchellh merged 26 commits into
mainfrom
split-drag
Dec 29, 2025
Merged

mitchellh merged 26 commits into
mainfrom
split-drag

Conversation

@mitchellh

Copy link
Copy Markdown
Contributor

Related to #1525

This implements a Mouse-only approach to moving splits. When you hover near the top of a split, a grab handle now appears that can be used to drag the split into any other split position.

Note

This PR only lets you move splits to other split positions. I will create follow-up issues to track moving a split out into a new tab or window.

Demo

CleanShot.2025-12-29.at.06.37.17.mp4

Other Notes

This PR also lays a ton of the groundwork on macOS for surfaces to be draggable and copyable (pasteboard) in general. That isn't used yet but there might be some interesting ideas here like pasting screenshots by simply dragging the surface. I don't know!

@mitchellh
mitchellh merged commit 14a56e3 into main Dec 29, 2025
160 of 161 checks passed
@mitchellh
mitchellh deleted the split-drag branch December 29, 2025 16:29
@flq

flq commented Feb 20, 2026

Copy link
Copy Markdown

This is so cool! I just realize that the last ghostty release is from last October, so to use this I actually have to build from source, or is there some release planned?

@pluiedev

Copy link
Copy Markdown
Member

1.3 is scheduled to release in March.

https://ghostty.org/docs/install/release-notes/1-2-0#moving-to-a-marchseptember-release-cycle

@htahboub

Copy link
Copy Markdown

Hi @mitchellh, was wondering if there's a built-in way to turn this feature off. I'm not planning on using it but I don't like the look of the grab handle being there when my mouse is on a split. Any way to hide it?

@00-kat

00-kat commented Mar 10, 2026 •

Copy link
Copy Markdown
Contributor

Not presently, open a new discussion if one doesn't already exist.

Edit: #10108.

@danielwe

Copy link
Copy Markdown
Contributor

Also xref #10280, see the last few comments, looks like a feature or vouch request for shrinking the handle's mouse tracking area would be welcome.

jemal added a commit to jemal/ghostty that referenced this pull request Jul 14, 2026
Adds a move_split action (up/down/left/right) that swaps the active
split with its nearest spatial neighbor, scoped to the current split
tree so splits can't be moved across tabs or windows. GTK-only; no
default keybind is set, bind it yourself e.g.
`keybind = alt+shift+h=move_split:left`.

The tree-manipulation core (SplitTree.moveSplit, plus a locate() helper
on the datastruct split tree) is adapted from upstream's in-progress
mouse drag-and-drop implementation (ghostty-org#10423, itself
a GTK port of macOS PR ghostty-org#10090), but exposed here via a keybind instead
of a drag handle, per issue ghostty-org#10224.

Plumbing follows the existing goto_split action end-to-end: a new
MoveSplit C-ABI enum in apprt/action.zig + include/ghostty.h (appended
at the end for ABI compatibility), a Binding.zig keybind action and
command palette entries, and dispatch through Surface.zig into the
gtk apprt.
pluiedev added a commit to pluiedev/ghostty that referenced this pull request Aug 5, 2026
One major todo is moving splits across different split trees (i.e.
moving across tabs and windows), but that would involve a lot more logic.
This MVP version works for now.

GTK version of ghostty-org#10090

Closes ghostty-org#10224
jcollie added a commit that referenced this pull request Aug 5, 2026
One major todo is moving splits across different split trees (i.e.
moving across tabs and windows), but that would involve a lot more
logic. This MVP version works for now.

Video demo (somehow the encode quality is terrible - I'll fix this
later):


https://github.com/user-attachments/assets/a5029451-9641-4680-bff6-38f52ebded4b


GTK version of #10090

Closes #10224
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants