Skip to content

fix: keep streaming markdown live window updating mid-line - #5590

Closed
tonycoder-hub wants to merge 1 commit into
Aider-AI:mainfrom
tonycoder-hub:cursor/fix-mdstream-live-window-repaint-5754
Closed

fix: keep streaming markdown live window updating mid-line#5590
tonycoder-hub wants to merge 1 commit into
Aider-AI:mainfrom
tonycoder-hub:cursor/fix-mdstream-live-window-repaint-5754

Conversation

@tonycoder-hub

Copy link
Copy Markdown

MarkdownStream.update returned early when no new stable lines were ready, so the live window froze mid-line and a final update with no new lines left the rich Live renderer running. When fewer lines than live_window had rendered, a negative slice also hid the first lines.

Guard only the print-above-window path and clamp the stable line count at 0. Tests: python3 -m pytest tests/basic/test_mdstream.py -q -> 3 passed. Distinct from #4577/#4579 (theming) and #5583-#5589.

MarkdownStream.update() returned early whenever no new *stable* lines had
appeared above the live window. Two things were then skipped:

- the live window itself was never repainted, so partial text appended to
  the last rendered line stayed invisible until a new line was completed
- on a final update it left the rich Live display running and self.live set

Also clamp the stable line count at 0. While fewer lines are rendered than
live_window, the negative count sliced lines[num_lines:] from the *end*, so
the live window dropped the leading lines of a response that had not been
printed above it yet.

Co-authored-by: Tony Coder <407243179@qq.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@tonycoder-hub

Copy link
Copy Markdown
Author

Closing as stale — opened on or before 2026-08-17 and still unmerged.

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