Skip to content

Fix vterm resize rendering for AI sessions#352

Merged
tninja merged 1 commit into
tninja:mainfrom
cjf-666:codex/fix-vterm-resize
May 15, 2026
Merged

Fix vterm resize rendering for AI sessions#352
tninja merged 1 commit into
tninja:mainfrom
cjf-666:codex/fix-vterm-resize

Conversation

@cjf-666
Copy link
Copy Markdown
Contributor

@cjf-666 cjf-666 commented May 15, 2026

Avoid installing the height-only reflow advice for vterm, and route vterm dimension sync through its native resize handler. Flush queued vterm redraw output during resize instead of dropping it, so Codex-style TUIs keep their terminal state consistent without losing pending output.

Add regression coverage for vterm resize behavior and stale advice cleanup.

Avoid installing the height-only reflow advice for vterm, and route vterm
dimension sync through its native resize handler. Flush queued vterm redraw
output during resize instead of dropping it, so Codex-style TUIs keep their
terminal state consistent without losing pending output.

Add regression coverage for vterm resize behavior and stale advice cleanup.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves terminal resize behavior for AI session buffers (especially Codex-style TUIs) by avoiding the previous “height-only reflow” advice path for vterm and instead delegating resizing to vterm’s native resize handler, while also ensuring any delayed vterm render output is flushed during resize to keep terminal state consistent.

Changes:

  • Stop installing the reflow-filter advice for vterm resize handlers; keep it only for eat.
  • Route vterm dimension syncing through vterm’s native resize handler and flush queued vterm render output during resize.
  • Add regression tests covering vterm resize syncing, render-queue flushing, and stale reflow-advice cleanup.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
ai-code-backends-infra.el Adjusts resize handler lookup to accept an optional backend, disables reflow advice for vterm, and routes vterm dimension sync through vterm’s native resize handler (with render-queue flush).
ai-code-backends-infra-vterm.el Adds a helper to immediately flush any queued/delayed vterm render output (used during resize).
test/test_ai-code-backends-infra.el Updates/extends ERT coverage to ensure vterm no longer receives reflow advice, stale advice is removed, and vterm resize syncing flushes queued output.

@tninja
Copy link
Copy Markdown
Owner

tninja commented May 15, 2026

@cjf-666 Thanks for the change. Will take a look

@tninja
Copy link
Copy Markdown
Owner

tninja commented May 15, 2026

Change looks good!

@tninja tninja merged commit 03d91d6 into tninja:main May 15, 2026
1 check 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.

3 participants