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

Unnecessary use of pipes disables terminal features #108

Closed
jaens opened this issue Apr 19, 2020 · 4 comments · Fixed by #109
Closed

Unnecessary use of pipes disables terminal features #108

jaens opened this issue Apr 19, 2020 · 4 comments · Fixed by #109

Comments

@jaens
Copy link

jaens commented Apr 19, 2020

onchange always pipes the stdout of the child process, which causes the child process to think it's not running in a terminal (as that's how most utilities detect whether they are running in a TTY).

This disables useful features such as color highlighting (in log messages etc.).

Ideally, stdout should not be piped unless it's necessary (due to the other command-line options),.

@blakeembrey
Copy link
Collaborator

@jaens Wouldn't you always want the output of your executed command to be printed? Changing this would be a backward incompatible change, if I understand what you're asking for. I also believe, but am not 100% familiar, that modules don't detect color based on whether they're being piped, but through isTTY. Can you show an example that would be fixed by avoiding piping?

@blakeembrey
Copy link
Collaborator

Did a test, this comes down to incorrect options for stdio in spawn. I can open a PR, it seems to work as expected in the new case.

@blakeembrey
Copy link
Collaborator

Released in 6.1.1, let me know if this resolves your issue!

@jaens
Copy link
Author

jaens commented Apr 22, 2020

Yeah, what I meant is exactly what you did - not calling the .pipe() method, instead just passing through stdout directly.

Colors (isTTY) works now, thanks!

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 a pull request may close this issue.

2 participants