[Bug] Spinner message is repeated infinitely if terminal window width is smaller than message width
Lms24 opened this issue · comments
Lukas Stracke commented
Environment
- OS: MacOS
- Node Version: v16.14.0, also tested w/ Node 18 and Node 20
- Package:
@clack/prompts
- Package Version: 0.6.3
Describe the bug
When the terminal in which a clack Spinner is run is smaller than the line length of the spinner.start()
message, it is printed repeatedly to the terminal instead.
To Reproduce
Minimal reproduction: https://stackblitz.com/edit/node-xdzhbp?file=index.js
Steps to reproduce the behavior:
- run
node index.js
- resize terminal window with to be smaller than the spinner message length
==> message is repeated infinitely
Expected behavior
The spinner message is not repeated infinitely but the original one is updated instead.
Additional Information
Our current workaround is to just print very short messages but ofc it'd be better to fix this properly.
Please let me know how we can help fixing this bug.