Skip to content

Improve spinner's cancel messages #209

@luiguild

Description

@luiguild

const msg = code > 1 ? 'Something went wrong' : 'Canceled';

Hello, first of all, thank you for your lib, I've been use it for a while now, and I really want to help you to improve it if it's the case.

I want to find a way to change some behaviors, in this particular case I want to have better cancel messages. The reason for this is that my CLI is multilingual, and these messages end up breaking my flow. All other messages I can customize without issues or, at the very least, intercept the flow to rewrite the output in the terminal.

I believe a good way to work around this would be to capture the spinner’s exit event using the isCancel method, just as we can do with prompts. I understand that the method’s purpose is different for prompts, but I believe this approach would maintain the library’s consistency.

Another idea could be to allow passing this message to the constructor when we instantiate the spinner.

I’m open to helping and submitting a PR with these modifications, but I’d like to know your opinion on this. How do you see this situation?

Once again, thank you.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions