Skip to content

Add Ctrl+click-drag to resize window splits#9447

Open
mcrmck wants to merge 1 commit intokovidgoyal:masterfrom
mcrmck:mouse-drag-resize
Open

Add Ctrl+click-drag to resize window splits#9447
mcrmck wants to merge 1 commit intokovidgoyal:masterfrom
mcrmck:mouse-drag-resize

Conversation

@mcrmck
Copy link

@mcrmck mcrmck commented Feb 1, 2026

Summary

  • Adds Ctrl+left-click-drag to resize window splits, a long-requested feature (see Using the mouse to resize splits? #5959)
  • Detects which windows border the click position using neighbor info from the layout, then resizes in cell-sized increments during drag
  • Shows a move cursor while dragging, restores default cursor on release
  • Based on the patch by @pcewing from the discussion, with a fix for sparse NeighborsMap keys and the addition of a resize cursor

Changes

  • kitty/mouse.c: Intercepts Ctrl+left-click to start drag resize, tracks mouse movement, ends on release. Sets move cursor during drag.
  • kitty/boss.py: drag_resize_start/update/end methods that compute resize deltas in cell units and call resize_layout_window
  • kitty/layout/base.py: drag_resize_target_windows method that determines which windows to resize based on click position and neighbor layout
  • kitty/state.h: Adds active_drag_resize flag to GlobalState

Test plan

  • All 162 existing tests pass
  • Manual testing: horizontal resize with vertical border drag
  • Manual testing: vertical resize with horizontal border drag
  • Manual testing: mouse release stops resize
  • Manual testing: normal click/select works without Ctrl held
  • Manual testing: move cursor shown during drag, default cursor restored after

🤖 Generated with Claude Code

Enable Ctrl+left-click-drag to resize window splits. Detects which
windows border the click position using neighbor information from the
layout, then resizes in cell-sized increments as the mouse moves.
Shows a move cursor during the drag operation.

Closes kovidgoyal#5959

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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