Skip to content

fix(printer): handle multiline permanent progress correctly#445

Open
gcomneno wants to merge 1 commit into
canonical:mainfrom
gcomneno:contrib/issue-371-multiline-progress-overwrite-clean
Open

fix(printer): handle multiline permanent progress correctly#445
gcomneno wants to merge 1 commit into
canonical:mainfrom
gcomneno:contrib/issue-371-multiline-progress-overwrite-clean

Conversation

@gcomneno
Copy link
Copy Markdown
Contributor

Summary

Handle multiline permanent progress updates correctly when replacing a previous temporary progress message.

Previously, a permanent multiline progress message could leave leftover text from the previous temporary progress line on the terminal, and multiline progress text was also logged as a single string containing embedded newlines.

This change formats terminal multiline progress output line-by-line so each rendered line is fully cleared, and logs multiline message text as separate timestamped lines.

Testing

pytest -q tests/integration/test_messages_integration.py -k "multiline_permanent_progress_overwrites_temporary_progress" -rs -vv
pytest -q tests/unit/test_printer.py -k "_log or writelineterminal" -rs
ruff check craft_cli/printer.py tests/integration/test_messages_integration.py tests/unit/test_printer.py

@gcomneno
Copy link
Copy Markdown
Contributor Author

The functional test matrix is passing. The remaining failures appear unrelated to this change:

  • OSV-scanner reports GHSA-6w46-j5rx-g56g for pytest 9.0.2 in generated requirements, while the source scan reports no issues.
  • lint / files fails only in ty diagnostics outside this PR's diff. This PR changes only craft_cli/printer.py and tests/integration/test_messages_integration.py; ruff, mypy, pyright, formatting, and the test jobs are passing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant