← Back to issue list

`open_stream()` allows control characters through the stream that affect the full output

View original Github issue

Metadata

Project
craft-cli
Number
#415
Type
issue
State
closed
Author
lengau
Labels
Status: Triaged Type: Bug
Created
Updated
Closed

Current evaluation

Fixed terminal-style leakage from open_stream() by resetting styling on close in merged PR #444 (commit 2253735).

Resolution: closed resolved

Reason: Merged PR #444, commit 2253735, resets terminal styling when the open_stream() context closes, preventing ANSI sequences written to the stream from affecting subsequent output.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description If you're using a stream from the emitter, it can send through control characters. This is mostly fine, except that these control characters can change (for example) the colour of the text output to the full system, and we never reset this. ### To Reproduce Open a stream, send a control character (e.g. changing the text colour, `0;30`) to the stream, and then close the stream and print something else out. ### part yaml ```shell ``` ### Relevant log output ```shell n/a ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed terminal-style leakage from open_stream() by resetting styling on close in merged PR #444 (commit 2253735).
stealth/space-bunny-alpha — closed stale A fix was reportedly opened to reset terminal styles when open_stream() closes, but the supplied record gives no PR reference or evidence that it was merged.
qwen3.6-35b-a3b-mtp-q6 — — Resolved by resetting terminal styles when the open_stream() context closes, preventing ANSI control characters from affecting subsequent output. The fix was merged and the issue closed.
qwen/qwen3.8-27b
Impact: 40
Quick Win: 28
Staleness: 40
Complexity: 30
Confidence: 70
Support Request: 5
keep open open_stream() lets ANSI control chars (e.g. color codes) leak into subsequent terminal output without reset. Triaged bug; contributor gcomneno opened a fix PR (link empty in comment) that resets terminal style on stream close, awaiting review.
qwen/qwen3.6-35b-a3b
Staleness: 45
Complexity: 25
Confidence: 90
Support Request: 5
keep open open_stream() leaks terminal control characters into subsequent output. Triaged bug with a proposed fix that resets ANSI sequences on stream close, awaiting maintainer review.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 40
Confidence: 90
Support Request: 10
keep open Bug where open_stream() leaks terminal control characters to subsequent output. Triaged and currently has an open fix from a contributor that resets styles on stream close.

Update history

Date Change
closed

Related work

  • Likely Fixed By: canonical/craft-cli#444 (confidence 100%)

    PR #444 was merged as commit 2253735 and directly implements the reported fix.

Related issues

Issue Project State Summary Similarity
#444 fix(messages): reset terminal style after open_stream craft-cli merged Merged PR #444 as commit 2253735, resetting terminal styling when open_stream() closes to prevent ANSI style leakage into subsequent output.
76%