fix(messages): reset terminal style after open_stream
Metadata
Current evaluation
Merged PR #444 as commit 2253735, resetting terminal styling when open_stream() closes to prevent ANSI style leakage into subsequent output.
Resolution: closed resolved
Reason: PR #444 was merged as commit 2253735. Its stream exit path now calls printer.reset_terminal_style(), which emits an ANSI reset for supported terminals.
Evaluated by: mr-cal-bot
No scores available.
Issue body
## Summary
Reset terminal style after `open_stream()` closes.
If output written through `open_stream()` includes ANSI control sequences that alter terminal styling, that styling could affect subsequent output because no reset sequence was emitted when the stream context manager exited.
This change adds a terminal-style reset on stream close through the printer layer, and includes focused unit and integration coverage.
## Testing
```bash
pytest -q tests/unit/test_messages_stream_cm.py -rs
pytest -q tests/integration/test_messages_integration.py -k "third_party_output_brief_terminal or open_stream_no_text" -rs
ruff check craft_cli/messages.py craft_cli/printer.py tests/unit/test_messages_stream_cm.py tests/integration/test_messages_integration.py
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #444 as commit 2253735, resetting terminal styling when open_stream() closes to prevent ANSI style leakage into subsequent output. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #444 as commit 2253735, resetting ANSI terminal styling when open_stream() closes to prevent style leakage into later output. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #444 as commit 2253735, resetting terminal styling when open_stream() closes to prevent ANSI style leakage into subsequent output. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged fix that resets terminal ANSI styling after open_stream() exits to prevent style bleed. Adds a reset sequence in the printer layer with unit and integration tests. Passed CI and received reviewer approval. | |
| qwen/qwen3.8-27b |
Impact:
45
Quick Win:
29
Staleness:
5
Complexity:
35
Confidence:
85
|
needs review | Adds a terminal-style reset on open_stream() close so ANSI sequences from subprocess output don't leak into subsequent output. Approved, all CI passing, author active (rechecked against main 0 days ago). | |
| qwen/qwen3.6-35b-a3b |
Staleness:
45
Complexity:
20
Confidence:
80
|
needs review | Fixes ANSI terminal styling persistence after open_stream() closes by adding a reset sequence. PR includes focused tests and has passed CI checks, awaiting maintainer review. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
25
Complexity:
15
Confidence:
85
|
needs review | Fixes terminal styling bleed after open_stream() by emitting a reset sequence on close. Includes unit and integration tests. Awaiting maintainer review after author resolved unrelated CI failures. |
Update history
| Date | Change |
|---|---|
| updated | |
| updated | |
| updated | |
| updated | |
| updated |
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #415 `open_stream()` allows control characters through the stream that affect the full output | craft-cli | closed | Fixed terminal-style leakage from open_stream() by resetting styling on close in merged PR #444 (commit 2253735). |