fix(gui): prevent prompt duplication when dragging split pane divider - #12
Merged
Merged
Conversation
When dragging the split divider between two panes, every mouse move
event triggered resize_split_by() which sent TIOCSWINSZ to the PTY.
The shell received ~60 SIGWINCH signals per second and redrew its
prompt on each one, causing overlapping/garbled prompt text.
Fix by decoupling terminal state resize from PTY notification during
split drag:
- Add Pane::resize_visual() trait method that updates terminal state
only (no PTY ioctl). LocalPane overrides it to skip pty.resize().
- Add Tab::resize_split_by_visual() that cascades using resize_visual.
- During drag, call resize_split_by_visual() for smooth content reflow
without SIGWINCH.
- On mouse release, call Tab::flush_pane_pty_sizes() to send one final
TIOCSWINSZ per pane with correct DPI from get_dimensions().
- Track drag state via SplitDragState { tab_id } to ensure the same
tab is used from drag start through release, with fallback recovery
if the tab is closed mid-drag.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
tw93
added a commit
that referenced
this pull request
Feb 11, 2026
…ompt fix(gui): prevent prompt duplication when dragging split pane divider
Author
|
Thanks for catching that edge case and merging! You're right — retargeting
to another tab with stale split metadata (index/position from the original
tab) is unsafe. Stopping the drag is the correct behavior. Appreciate the
thorough review.
Tw93 ***@***.***> 于2026年2月11日周三 14:56写道:
… *tw93* left a comment (tw93/Kaku#12)
<#12 (comment)>
Thanks for the fix and verification. Merged in #12
<#12>.\n\nI also reviewed a follow-up
edge case (drag in tab A, tab A closes mid-drag): we now stop the drag
instead of retargeting another tab with stale split metadata. This avoids
accidental split resize in a different tab.
—
Reply to this email directly, view it on GitHub
<#12 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATIQ347BMWQCAUEPHECEWUD4LLHA7AVCNFSM6AAAAACUWKXSDCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTQOBSGY4TONRSHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
tw93
added a commit
that referenced
this pull request
Feb 27, 2026
…ompt fix(gui): prevent prompt duplication when dragging split pane divider
tw93
added a commit
that referenced
this pull request
May 6, 2026
…ompt fix(gui): prevent prompt duplication when dragging split pane divider
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #10
Pane::resize_visual()trait method with safe default fallback for all pane typesChanges
mux/src/pane.rsresize_visual()default trait method (falls back toresize())mux/src/localpane.rsresize_visual(): onlyterminal.resize(), skippty.resize()mux/src/tab.rsresize_split_by_visual(),cascade_size_from_cursor_visual(),flush_pane_pty_sizes()kaku-gui/src/termwindow/mod.rsSplitDragState { tab_id }to track drag lifecyclekaku-gui/src/termwindow/mouseevent.rsTest plan
🤖 Generated with Claude Code