Skip to content

Conversation

dipu989
Copy link
Contributor

@dipu989 dipu989 commented Oct 16, 2024

Pull Request Description

Fix for Issue #388: Spinner Output Cleanup

This pull request addresses the issue described in GitHub issue #388, where the spinner output was generating unprintable characters.

Changes Made:

Initialized the spinner with a default stderr writer.
Redirected all spinner output to stderr, ensuring that it does not interfere with standard output.
This adjustment prevents any unprintable characters from appearing in the final output, enhancing the overall user experience when using the CLI.

Before Change -
WhatsApp Image 2024-10-16 at 8 15 05 AM

After Change -
Screenshot 2024-10-16 at 8 24 13 AM

Impact:
This change improves the clarity and usability of the Civo CLI by ensuring that output for this particular command (with -wait flag) is formatted correctly in every case.

@dipu989
Copy link
Contributor Author

dipu989 commented Oct 16, 2024

@uzaxirr @fernando-villalba
For now, I have only proposed a solution for the command mentioned in the ticket. If this approach looks good, I can raise similar changes for subsequent commands that support the -wait flag as well.

@fulviodenza
Copy link
Contributor

Hi @dipu989 , i've seen we are already doing that, such as here

			s := spinner.New(spinner.CharSets[9], 100*time.Millisecond)
			s.Writer = os.Stderr

This could be done better in my opinion using the spinner.WithWriter function you used in this PR instead of a new line for setting the writer to Stderr.

If you will open a PR for that, I will be happy to review it

@giornetta
Copy link
Member

I agree with @fulviodenza. I like this approach better than what we currently have.

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

Successfully merging this pull request may close these issues.

3 participants