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

Progress bar won't render when redirecting output to a file #162

Open
jainanshul opened this issue Aug 28, 2017 · 4 comments
Open

Progress bar won't render when redirecting output to a file #162

jainanshul opened this issue Aug 28, 2017 · 4 comments

Comments

@jainanshul
Copy link

I have a node program that used progress bar to display the progress of various long running operations. I redirect the output to a file to be viewed later but the no information about the progress bar is being stored in the file. I only see empty new lines instead of progress bar. I don't expect the progress bar to show the progress bar itself but if it can at least write the progress percentage in the file it would really help.

@roccomuso
Copy link

Probably because this module works only with a writable stream in a text terminal (tty) context.

Check lib/node-progress.js#L126

if (!this.stream.isTTY) return;

@db-ryan
Copy link

db-ryan commented Dec 8, 2017

But if you comment that line out you get the error seen here: #166

Or, at least I do. So I am wondering if there is a workaround. I am basically just using tee to capture this to a log. I don't need the log to be pretty.

@db-ryan
Copy link

db-ryan commented Dec 8, 2017

The fix in this issue works:

#110

I will try to work on a PR that includes this as a forced option.

@ryan-frankel
Copy link

I made the PR to add this as an option: #168

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

4 participants