Skip to content

Add Ghostty-style drag-to-resize for terminal split panes#22

Merged
nwparker merged 1 commit intomainfrom
nwparker/resiz-epane
Mar 22, 2026
Merged

Add Ghostty-style drag-to-resize for terminal split panes#22
nwparker merged 1 commit intomainfrom
nwparker/resiz-epane

Conversation

@nwparker
Copy link
Copy Markdown
Contributor

Summary

  • Wider hit area: Dividers use a CSS ::after pseudo-element for the visible line, while the element itself is a wider transparent grab zone (~10px total). This prevents the old bug where background shorthand resets wiped background-clip.
  • Persist split ratios: Serialization now captures flex-grow ratios into the layout snapshot (ratio field on split nodes), and replayTerminalLayout restores them — resized panes survive tab switches.
  • Double-click to equalize: Double-clicking a divider resets both sibling panes to 50/50, matching Ghostty behavior.
  • Layout change on drag-end: onLayoutChanged fires after a real drag so ratio persistence is triggered automatically.

Test plan

  • Split a terminal (Cmd+D / Cmd+Shift+D), verify blue divider line is visible
  • Hover divider — should highlight even in the transparent padding zone
  • Drag divider to resize panes, verify smooth real-time resize
  • Switch tabs and back — verify resized ratios are preserved
  • Double-click divider — panes should snap back to equal size
  • Nested splits (3+ panes) — verify dividers and resize work at all levels

🤖 Generated with Claude Code

- Wider invisible hit area around dividers (visible line drawn via CSS
  ::after pseudo-element) for easier grabbing
- Persist split ratios in layout snapshots so resized panes survive
  tab switches and restores
- Double-click divider to equalize sibling panes
- Notify onLayoutChanged after drag-end to trigger ratio persistence

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nwparker nwparker merged commit 4d65b9e into main Mar 22, 2026
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.

1 participant