canonical / craft-cli

https://canonical-craft-cli.readthedocs-hosted.com/en/latest/
GNU Lesser General Public License v3.0
9 stars 15 forks source link

When the Printer stops it needs to clean the last line if it was transient progress #125

Open facundobatista opened 1 year ago

facundobatista commented 1 year ago

This will show both when stopping everything and when calling pause.

For example, check the two following codes:

    emit.progress("Long text")
    time.sleep(5)
    with emit.pause():
        print("inside")
    emit.message("Done")

and

    emit.progress("Long text")
    time.sleep(5)

In the first case the text inside should overwrite "Long text", and in the second case whatever comes next because the process ends (e.g. the shell prompt) it should overwrite "Long text".

IOW, "Long text" should not remain in the screen after "the next thing comes" (because it's transient progress).