This replaces the current spinner implementation with the one that is provided by indicatif.
Rationale
The current spinner breaks the output on narrow terminals for long spinner messages. This results in the spinner filling up the terminal with a new line for every progress update.
A few other spinner libraries e.g. spinners where taking into consideration, but indicatif turned out to be the best choice in terms of flexibilty and future maintenance. The drawback is obviously that indicatif is built on top of console, yet another terminal abstraction library that is added to our dependencies besides crossterm. But it can be argued, that crossterm is rather low-level, whereas console is more high-level, thus having both is a valid use case.
In order to be able to replace the current spinner with indicatif, the standard I/O stream abstraction was refactored and now provides a RenderTarget, which supports switching streams.
Additionally, it introduces output macros for warnings and errors.
This replaces the current spinner implementation with the one that is provided by indicatif.
Rationale
The current spinner breaks the output on narrow terminals for long spinner messages. This results in the spinner filling up the terminal with a new line for every progress update.
A few other spinner libraries e.g. spinners where taking into consideration, but indicatif turned out to be the best choice in terms of flexibilty and future maintenance. The drawback is obviously that indicatif is built on top of console, yet another terminal abstraction library that is added to our dependencies besides crossterm. But it can be argued, that crossterm is rather low-level, whereas console is more high-level, thus having both is a valid use case.
In order to be able to replace the current spinner with indicatif, the standard I/O stream abstraction was refactored and now provides a RenderTarget, which supports switching streams.
Additionally, it introduces output macros for warnings and errors.
In general this LGTM, but there are two instances where stderr should be used IMHO instead of stdout,… and I am not sure whether stdout is used on purpose (if, a comment would be nice).
Rebased and added two review commits.
While the direction is good in terms of UI, I don’t like that signal handling is removed. Erik, do you have a plan there? I would like to get at least the level of signal handling back that we had before, maybe even the ability to forward the intent of the user to stop the process.
This revision is a fresh start and aims to leave the inners of the spinner intact as much as possible. It also get’s rid of the newly introduced output macros. These replicate a weird existing pattern that should probably be removed in the future anyways.
REVIEW: static template
Use static + LazyLock to ensure that the templates evaluation only
happens once and the value can be re-used on each subsequent access.
Incorporate review.
Rename DrawTarget to PaintTarget (since we have a Paint type already).
Rebase