Skip to content

Node ignoring redirections when redirected to a tty #4222

Closed
@ELLIOTTCABLE

Description

@ELLIOTTCABLE

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 different tty:

$ node -e 'process.stdout.write("wtf!\n")' 1>/dev/ttys014
wtf!

Example:

# First term:                                                           │# Second term:$ tty                                                                   │$ tty
/dev/ttys013                                                            │/dev/ttys014
$ echo 'abc' 1>/dev/ttys014                                             │$ cat
$ ruby -e '$stdout.puts "okay"' 1>/dev/ttys014                          │abc
$ node -e 'process.stdout.write("wtf!\n")' 1>/dev/ttys014               │okay
wtf!                                                                    │
$ node -e 'process.stdout.write("this works\n")' 1>/dev/null            │
$ node -e 'process.stdout.write("this too\n")' 1>output                 │
$ cat output                                                            │
this too                                                                │

Environment:

System: Mac OS X El Capitan 10.11.1
Shell: Zsh 5.1.1 (x86_64-apple-darwin15.0.0)
Node: v4.2.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.libuvIssues and PRs related to the libuv dependency or the uv binding.ttyIssues and PRs related to the tty subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions