click-spinner
click-spinner copied to clipboard
Fix output in corner cases
This PR contains two separate bugfixes:
- beep shouldn't be written to stdout when redirected, and
- always erase the spinner on exit.
(1) is self-explanatory, but (2) might require some background. Currently, the spinner character is left on screen after the spinner exits if the next character written to stdout is a control character (newline, tab, etc.), but is erased if the next character written is printable. This inconsistent behavior looks like a bug to me.