Skip to content

Only send SIGWINCH when pane terminal size actually changes (#4187)#5095

Open
AungMyoKyaw wants to merge 1 commit into
tmux:masterfrom
AungMyoKyaw:fix-sigwinch-zoom-panes
Open

Only send SIGWINCH when pane terminal size actually changes (#4187)#5095
AungMyoKyaw wants to merge 1 commit into
tmux:masterfrom
AungMyoKyaw:fix-sigwinch-zoom-panes

Conversation

@AungMyoKyaw

Copy link
Copy Markdown

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_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.

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.
Copilot AI review requested due to automatic review settings May 15, 2026 16:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 current winsize with TIOCGWINSZ and return early when ws_col/ws_row already equal the requested sx/sy.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nicm nicm moved this from Not Started to Waiting in All Issues & PRs Jun 9, 2026
@nicm nicm moved this from Waiting to Not Started in All Issues & PRs Jun 9, 2026
@nicm

nicm commented Jun 11, 2026

Copy link
Copy Markdown
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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Not Started

Development

Successfully merging this pull request may close these issues.

Don't send SIGWINCH when moving between zoomed panes with "select-pane -Z"

4 participants