-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Node ignoring redirections when redirected to a tty #4222
Comments
I've reproduced the same thing on Yosemite in stock bash, in node |
This behavior is due to Lines 54 to 65 in 65b86c0
It appears that libuv assumes if the fd is a tty it must be the originating console. One workaround is to use an intermediate pipe:
|
Hm. Okay, thanks for hunting that down for me; I might try to patch upstream. Either way, I'll leave this open until it's fixed there? |
Yeah, I think it should be left open as it's a node regression. It does not happen on jxcore which is a pre 0.12 node fork. Haven't tried running on older versions of node 0.10 or node 0.12 It was introduced here: |
/cc @saghul |
This looks like it may have been discussed before, by the way: |
Ahoi! @ELLIOTTCABLE can you try the patch in libuv/libuv#528? It should apply pretty much cleanly to deps/uv and the rebuild Node and test. Let me know if you run into issues with it. |
The patch in libuv/libuv#528 appears to work on Mac against node v5.1.1 sources with stdout and stderr tty redirects. (Edit: patch as of Dec 10, 2015) |
libuv patch status update: libuv/libuv#528 (comment) |
Please have a look at libuv/libuv#779. I'm considering libuv/libuv#528 obsolete. |
@ELLIOTTCABLE can you confirm this is fixed in master now with libuv 1.9.0? |
Closing as this issue should be fixed. |
Can confirm, functioning as expected in v6.2.1. 💯 |
So, although redirects to other active file-descriptors work as expected, as do redirections to files and the
/dev/null
device, I cannot redirect successfully to a differenttty
:Example:
Environment:
System: Mac OS X El Capitan
10.11.1
Shell: Zsh
5.1.1 (x86_64-apple-darwin15.0.0)
Node: v
4.2.3
The text was updated successfully, but these errors were encountered: