-
Notifications
You must be signed in to change notification settings - Fork 38
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
doesn't work in Webstorm run tool #17
Comments
same to me |
+1 |
This is because the plugin is disabled if the output is not a TTY, like WebStorm's Run window. |
Here's the upstream discussion in node-progress. Another library with the same issue ( |
The same issue is seen when running an application with This workaround helps in that case: var stream = options.stream;
if (!stream) {
stream = process.stderr;
if (!stream.isTTY) {
var tty = require('tty').WriteStream.prototype;
Object.keys(tty).forEach(function (key) {
process.stderr[key] = tty[key];
})
process.stderr.columns = 80;
}
} Unfortunately WebStorm's Run window doesn't support clearing the line, so keeps drawing new progress bars. |
+1 |
I made it work perfectly in Webstorm's run console (on Windows 10) by adding this TTY-mock before using the progress bar:
And creating the ProgressBar with the option "stream: process.stdout" The mocked cursorTo()-function enables overwriting the same line so that multiple lines are not rendered (at least on Windows, this must done before writing the actual line, so that's why process.stdout.write('\r') is put in cursorTo() and not in clearLine())) |
+1 |
I'm not sure this problem is in the package, but it works fine in terminal window and show nothing in "Run" window of Webstorm (I even didn't receive final callback).
The text was updated successfully, but these errors were encountered: