Fix vterm resize rendering for AI sessions#352
Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
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. |
Owner
|
@cjf-666 Thanks for the change. Will take a look |
Owner
|
Change looks good! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.