Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve spinner's cancel messages #209

Open
luiguild opened this issue Nov 20, 2024 · 0 comments
Open

Improve spinner's cancel messages #209

luiguild opened this issue Nov 20, 2024 · 0 comments

Comments

@luiguild
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant