canonical / canonical/craft-cli
Multi-line permanent progress doesn't overwrite temporary progress
- Dominant language
- Python
- Stars
- 16
- Forks
- 27
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 10
Description
### Bug Description
I assumed it was possible to pass multi-line strings to `emit.progress`. At least, craft-application does it. However, the first line doesn't overwrite the existing progress line if it was longer.
### To Reproduce
```python
from craft_cli import EmitterMode, emit
emit.init(EmitterMode.BRIEF, appname="testcraft", greeting="Greeting")
emit.progress("foo foo foo")
emit.progress("bar\nbar", permanent=True)
```
Expected output:
```
bar
bar
```
Actual output:
```
bar foo foo
bar
```
### part yaml
```shell
```
### Relevant log output
```shell
2025-08-11 15:02:50.183 Greeting
2025-08-11 15:02:50.183 foo foo foo
2025-08-11 15:02:50.183 bar
bar
```
Contributor guide
Research direction
Run the Python reproduction from the issue and inspect the implementation behind emit.progress, especially permanent multi-line output and temporary-line clearing. Confirm the behavior with the shown input; done means the first line of the permanent message fully replaces the longer temporary progress line, producing exactly two lines: bar and bar.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100