← Back to issue list

Linefeeds are wrong when output is redirected to file

View original Github issue

Metadata

Project
craft-cli
Number
#75
Type
issue
State
open
Author
cmatsuoka
Labels
Created
Updated
Closed

Current evaluation

Redirecting craft-cli output to a file produces mangled linefeeds (stray CRs and padding) instead of clean LF-terminated lines. No labels, no comments, no maintainer response; last activity 47 days ago. The captured-output path in printer.py exists but the reported mangling is not confirmed fixed.

Suggested action: needs triage

Reason: The issue has no labels, no comments, and no maintainer acknowledgement, so it has not been triaged. The captured-output path (_write_line_captured, _write_bar_captured) exists in printer.py and PR #98 added 'full support for captured output', but there is no evidence the specific CR/padding mangling reported here was addressed, so it cannot be closed as fixed. A maintainer needs to confirm whether the current captured-output path still emits stray CRs and padding when redirected to a file.

Impact: 40 Quick Win: 24.0 Staleness: 45 Complexity: 40 Confidence: 55 Support Request: 5

Issue body

When sending the output of a craft-cli application to a file we should translate CRs to LFs (and possibly remove the line padding), otherwise we end up with something like `Line 1 [padding] ^M Line 2 [padding] ^M Line3 [padding]`. This is the real output of snapcraft redirected to a file: ``` Launching instance... Initializing parts lifecycle ^MInstalling package repositories... Executing parts lifecycle... ^MInstalled package repositories ^MExecuting parts lifecycle: skip pull figlet (already ran) ^MExecuted: skip pull figlet (already ran) Executing parts lifecycle: skip overlay figlet (already ran) ^MExecuted: skip overlay figlet (already ran) Executing parts lifecycle: skip build figlet (already ran) ^MExecuted: skip build figlet (already ran) Executing parts lifecycle: skip stage figlet (already ran) ^MExecuted: skip stage figlet (already ran) Executing parts lifecycle: skip prime figlet (already ran) ^MExecuted: skip prime figlet (already ran) Executed parts lifecycle Generating snap metadata... ^MGenerated snap metadata Creating snap package... ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 40
Quick Win: 24.0
Staleness: 45
Complexity: 40
Confidence: 55
Support Request: 5
needs triage Redirecting craft-cli output to a file produces mangled linefeeds (stray CRs and padding) instead of clean LF-terminated lines. No labels, no comments, no maintainer response; last activity 47 days ago. The captured-output path in printer.py exists but the reported mangling is not confirmed fixed.
qwen/qwen3.6-35b-a3b
Staleness: 70
Complexity: 25
Confidence: 85
Support Request: 10
needs triage Formatting bug where CLI output redirected to a file contains carriage returns and padding instead of clean line feeds. Unlabelled and unassigned after over 4 years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 25
Confidence: 85
Support Request: 10
close stale Bug report describing incorrect line endings and carriage returns when redirecting craft-cli output to a file. Untriaged, zero comments, inactive for over 4 years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 35
Confidence: 80
Support Request: 10
close stale Redirecting craft-cli output to files produces incorrect line endings and residual padding, causing garbled text with carriage returns. The report remains open, inactive for over four years, with no comments or labels, awaiting triage or implementation.

Update history

No update history recorded yet.

Related work

  • Related To: craft-cli#98 (confidence 60%)

    PR #98 'Full support for captured output' introduced the captured-output code path (_write_line_captured / _write_bar_captured) that this issue's fix would live in, but it does not confirm the CR/padding mangling was resolved.

Related issues

No related issues found above the similarity threshold.