Skip to content

[Bug] Spinner message is repeated infinitely if terminal window width is smaller than message width #132

Open
@Lms24

Description

@Lms24

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.

Example:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Needs triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions