Skip to content

fix: Display.resize() handles buffer wider than visible window (#1210)#1634

Merged
gnodet merged 1 commit intojline-3.xfrom
backport/jline-3.x/fix-display-buffer-width-1210
Feb 19, 2026
Merged

fix: Display.resize() handles buffer wider than visible window (#1210)#1634
gnodet merged 1 commit intojline-3.xfrom
backport/jline-3.x/fix-display-buffer-width-1210

Conversation

@gnodet
Copy link
Member

@gnodet gnodet commented Feb 19, 2026

Summary

  • Backport of fix: Display.resize() handles buffer wider than visible window (#1210) #1633 to jline-3.x
  • On Windows, the terminal screen buffer can be wider than the visible window (e.g., buffer=2000, window=80). The windows-vtp terminal declares auto_right_margin, so Display expects auto-wrap at columns, but wrap actually occurs at the buffer width — causing cursor tracking desync and broken display output.
  • Display.resize() now queries terminal.getBufferSize() and disables wrapAtEol/delayedWrapAtEol when the buffer is wider than the visible columns, since content will never reach the buffer's right edge.
  • No API changes — callers continue to pass visible width to resize().

Fixes #1210

Test plan

  • Existing DisplayTest passes
  • Full terminal module test suite passes (105 tests)
  • Manual verification on Windows with wide screen buffer

…e window (#1210)

On Windows, the terminal can have a screen buffer width larger than the
visible window width (e.g., buffer=2000, window=80). The windows-vtp
terminal type declares auto_right_margin, so Display expects auto-wrap
at columns. But auto-wrap actually occurs at the buffer width, not the
visible width. This causes Display's cursor tracking to desynchronize,
resulting in only the first 1-2 lines being displayed.

Display.resize() now queries terminal.getBufferSize() to detect when the
buffer is wider than the requested columns. When this mismatch exists,
wrapAtEol and delayedWrapAtEol are disabled since content will never
reach the buffer's right edge within the visible area.
@gnodet gnodet force-pushed the backport/jline-3.x/fix-display-buffer-width-1210 branch from a214b55 to f9c61b2 Compare February 19, 2026 08:23
@gnodet gnodet merged commit 8d6bfa1 into jline-3.x Feb 19, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments