Add Ctrl+click-drag to resize window splits - #9447
Conversation
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>
|
That is exactly what i was looking for! However, i found a bug, when resize goes out of bounds, messes up with rendering PS1: kitty.mp4And i have a suggestion: Instead of CTRL + click, why not just make the borders draggeable? CTRL + click messes up with links |
|
That's a good find, thanks for sharing. Happy to take a look some time later this week. Personally, I agree that draggable borders would be preferable to Ctrl+click to resize. I believe this had been discussed in a separate thread, and this was @kovidgoyal 's preference. If he was ok with it, I would be happy to reimplement with draggable borders. Cheers. |
|
Discussion is in the original PR, see there. |
|
I can reproduce an issue where dragging the split handle sometimes moves the divider in the opposite direction. For example, dragging to the right can move the split to the left, and dragging upward can move it downward. It’s intermittent, but it tends to happen after resizing once and then dragging a border on a non‑active window. 2026-03-28.10.05.54.mov |
|
It would help to know what layout and how many windows etc. |
|
Here’s the session file (layout) for reference: |
|
@kovidgoyal It still has issues in some cases. Additionally, the drag action remains unresponsive in some cases, despite the cursor changing its visual state. 2026-04-01.10.36.38.movsession: |
|
On Tue, Mar 31, 2026 at 07:42:09PM -0700, zhaolei wrote:
zzhaolei left a comment (kovidgoyal/kitty#9447)
@kovidgoyal It still has issues in some cases.
Additionally, the drag action remains unresponsive in some cases, despite the cursor changing its visual state.
Should be fixed now. Also added some tests so hopefully wont break in
the future.
|
|
I suggest disabling diagonal dragging as it offers limited utility; Ghostty follows this same approach. 2026-04-01.1.47.19.mov |
|
On Tue, Mar 31, 2026 at 11:07:05PM -0700, zhaolei wrote:
zzhaolei left a comment (kovidgoyal/kitty#9447)
I suggest disabling diagonal dragging as it offers limited utility; Ghostty follows this same approach.
In this scenario it can be confusing, but that is not true in general.
And having diagonal dragging doesn't harm anything, if you don't like,
simply don't use it.
|
Summary
NeighborsMapkeys and the addition of a resize cursorChanges
drag_resize_start/update/endmethods that compute resize deltas in cell units and callresize_layout_windowdrag_resize_target_windowsmethod that determines which windows to resize based on click position and neighbor layoutactive_drag_resizeflag toGlobalStateTest plan
🤖 Generated with Claude Code