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

Progressbar always writing control characters to stdout. #518

Open
LennartC opened this issue Jun 1, 2023 · 2 comments
Open

Progressbar always writing control characters to stdout. #518

LennartC opened this issue Jun 1, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@LennartC
Copy link

LennartC commented Jun 1, 2023

When you create a progressbar with pterm.DefaultProgressbar.WithWriter(os.Stderr) you expect all the output to go to stderr.

However, in this commit: bc8595a

cursor.Show() and cursor.Hide() was added, which always outputs control characters to stdout.

This is an issue when you pipe the output to another command for example. You'll end up with �[?25l�[?25h at the beginning of the output.

@LennartC LennartC added the bug Something isn't working label Jun 1, 2023
@lammel
Copy link
Contributor

lammel commented Jun 12, 2023

This is somewhat related to #261. The cursor used is atomicgo.dev/cursor which is not capable of handling stderr currently.

There is a PR atomicgo/cursor#7 open there which needs some more love to be merged probably

@MarvinJWendt
Copy link
Member

Hi, I have updated cursor to support custom writers for the area. This could now be worked on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants