fix: preserve ansi output history on resize replay#24292
Closed
LeonSGP43 wants to merge 1 commit into
Closed
Conversation
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.
What does this PR do?
Preserves ANSI/Rich formatting in the CLI output history that is replayed after terminal redraws. The previous history recorder stripped ANSI control sequences before storing lines, so rich console output could lose styling when persistent output was replayed after a resize.
Related Issue
Fixes #24017
Type of Change
Changes Made
cli.pyso output history keeps ANSI formatting while still normalizing carriage returns and trailing newlines.ChatConsole.print()recording Rich-rendered ANSI output for replay.How to Test
scripts/run_tests.sh tests/cli/test_cprint_bg_thread.py tests/cli/test_cli_force_redraw.py.git diff --check.uv sync --frozen --extra allanduv run --frozen ruff check ..Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AFor New Skills
N/A — this PR does not add a skill.
Screenshots / Logs
Local verification: