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

using progrock from a non interactive console #13

Open
ymolists opened this issue Jan 22, 2024 · 1 comment
Open

using progrock from a non interactive console #13

ymolists opened this issue Jan 22, 2024 · 1 comment

Comments

@ymolists
Copy link

ymolists commented Jan 22, 2024

Hi folks.

Thank you very much for doing this nice library.

1 ) I am trying to run some tests that involve running progrock in a non iteractive terminal. As in when i am running go tests. So far i have not figured how to do it. Code as the below code seems to not run in a non interactive shell. i keep getting failed with progrock inappropriate ioctl for device. Can you please suggest a workaround ?

	err := progrock.DefaultUI().Run(ctx, writer, it.start)
	if err != nil {
		return err
	}
  1. i noticed that in tests located in the concole package
    you are using an io.Writer. Unfortunately a recorder created like that cannot be passed to progrock.DefaultUI().Run because that is expecting a *Tape. Is there a way around this to make progrock work properly in a non intercatinve shell ?
    BTW iam able to run all my tests from vscode because vscode supports using an integratedTerminal for running tests. I just cant do that when running tests from the command line so far. This is why i am thinking this has to do with the terminal
@vito
Copy link
Owner

vito commented May 17, 2024

Hi, sorry, missed the ping for this.

The Tape is meant to run with a TTY, and the console package is meant to be used when a TTY is not available.

They are both a progrock.Writer, which is the unifying interface between them; the idea is that your CLI should detect whether a terminal is present, and plug in whichever is appropriate.

Hope this helps, but given the delay you may have moved on. :)

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

2 participants