Only send SIGWINCH when pane terminal size actually changes (#4187)#5095
Open
AungMyoKyaw wants to merge 1 commit into
Open
Only send SIGWINCH when pane terminal size actually changes (#4187)#5095AungMyoKyaw wants to merge 1 commit into
AungMyoKyaw wants to merge 1 commit into
Conversation
Fixes tmux#4187. When switching between zoomed panes with select-pane -Z, tmux sends SIGWINCH even though the visible pane size is not changing. This causes programs like scp to mess up their progress output. Add a TIOCGWINSZ check in window_pane_send_resize before issuing TIOCSWINSZ. If the terminal already has the requested dimensions, skip the ioctl entirely. This is the robust fix because it handles all cases where tmux's internal size tracking and the terminal's actual size might diverge.
There was a problem hiding this comment.
Pull request overview
Fixes #4187 by avoiding an unnecessary SIGWINCH to the pane's child process when select-pane -Z toggles zoom but the resulting pane dimensions are unchanged. The fix queries the pty's current winsize via TIOCGWINSZ and skips the TIOCSWINSZ ioctl (which is what triggers SIGWINCH) when columns and rows already match the requested size.
Changes:
- In
window_pane_send_resize, read the currentwinsizewithTIOCGWINSZand return early whenws_col/ws_rowalready equal the requestedsx/sy.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
|
Does this change anything? What cases are we sending TIOCSWINSZ to a pty with the same size we have already sent it with the same size? |
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.
Fixes #4187.
When switching between zoomed panes with
select-pane -Z, tmux sends SIGWINCH even though the visible pane size is not changing. This causes programs like scp to mess up their progress output.Add a TIOCGWINSZ check in
window_pane_send_resizebefore issuing TIOCSWINSZ. If the terminal already has the requested dimensions, skip the ioctl entirely. This is the robust fix because it handles all cases where tmux's internal size tracking and the terminal's actual size might diverge.