canonical / canonical/craft-cli
Linefeeds are wrong when output is redirected to file
- Dominant language
- Python
- Stars
- 16
- Forks
- 27
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 12
Description
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...
```
Contributor guide
Assessment
This issue has not been assessed yet.