iTerm2 icon indicating copy to clipboard operation
iTerm2 copied to clipboard

Fix inconsistent bottom padding in split panes

Open csmarshall opened this issue 3 months ago • 1 comments

When a terminal window is split into panes, the text positioning is now calculated from the bottom up instead of top down. This ensures that all panes have consistent bottom padding equal to the configured margin (kPreferenceKeyTopBottomMargins), with any excess pixels that don't fit evenly into line heights placed at the top rather than the bottom.

Previously, integer division when calculating rows from height would place excess pixels at the bottom, causing visual misalignment between panes when heights didn't divide evenly by line height.

Changes:

  • Modified visibleRectExcludingTopMargin:startingAtRow: in PTYTextView.m to add a top offset equal to (excess - bottomMargin), aligning text from the bottom
  • Updated comments in the excess method to reflect its new usage for calculating top offset

🤖 Generated with Claude Code

csmarshall avatar Oct 30 '25 18:10 csmarshall

I suspect this will cause many bugs. For example, anywhere that excess is used, because there is a widespread assumption that the excess area is at the bottom.

gnachman avatar Oct 30 '25 21:10 gnachman