Skip to content

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

Merged
gnodet merged 1 commit intomasterfrom
fix/display-buffer-width-1210
Feb 19, 2026
Merged

fix: Display.resize() handles buffer wider than visible window (#1210)#1633
gnodet merged 1 commit intomasterfrom
fix/display-buffer-width-1210

Conversation

@gnodet
Copy link
Member

@gnodet gnodet commented Feb 19, 2026

Summary

  • 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 (135 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 fix/display-buffer-width-1210 branch from ef2db4a to 27d7445 Compare February 19, 2026 08:22
@gnodet gnodet merged commit 665828d into master 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Output of Display.update could be unexpected

1 participant

Comments