`node < /dev/tty` doesn't seem to work as expected on OSX #3072

Closed
TooTallNate opened this Issue Apr 7, 2012 · 20 comments

Projects

None yet

6 participants

@TooTallNate

https://gist.github.com/681256e480d4e8eae52d

Basically, I'm expecting to enter the REPL as usual, and basically the initial prompt gets printed and no keyboard input gets recognized at all.

read(1) seems to work as expected (as seen in the gist), so I would think at least in NODE_NO_READLINE mode would as, but that doesn't seem to work either.

This seems to only happen on OS X and works fine on Ubuntu.

@TooTallNate

After further investigation this appears to have been fixed by b6d6a54, which will be in the v0.7.8 release.

@TooTallNate TooTallNate closed this Apr 7, 2012
@isaacs isaacs reopened this Apr 9, 2012
@isaacs
isaacs commented Apr 9, 2012

b6d6a54 was reverted by 93eca95, because it caused #3075. Need to find another way to fix this.

@ssuda ssuda pushed a commit to ssuda/node that referenced this issue Apr 9, 2012
@isaacs isaacs Revert "build: target OSX 10.5 when building on darwin"
This reverts commit b6d6a54,
which fixed #3072, so we'll have to figure out another way
to make that work.
93eca95
@TooTallNate TooTallNate added a commit that closed this issue Apr 10, 2012
@TooTallNate TooTallNate Re-apply "build: target OSX 10.5 when building on darwin"
This reverts commit 93eca95.

Fixes #3072 (once again).
70a5b53
@TooTallNate TooTallNate reopened this Apr 10, 2012
@TooTallNate

It seems like applying -mmacosx-version-min=10.5 fixed things up until 0db4dc0 was applied. Now it seems like the flag doesn't help anymore, and I still get the hang on ./node < /dev/tty. /cc @bnoordhuis

@TooTallNate

Appears to be fixed now.

@TooTallNate

This seems to be happening again using node master (82bcdbb). Only now it's worse, getting an assertion failure from within libuv:

☮ ~/node (master) ⚡ ./node < /dev/tty
> Assertion failed: (!!(events & UV__IO_READ) ^ !!(events & UV__IO_WRITE)), function uv__stream_io, file ../deps/uv/src/unix/stream.c, line 730.
Abort trap: 6

/cc @bnoordhuis

@TooTallNate TooTallNate reopened this May 27, 2012
@bnoordhuis
Member

@TooTallNate: WFM. To wit:

$ out/Debug/node < /dev/tty
> 1+1
2
> 2+2
4
@isaacs
isaacs commented May 27, 2012

It works on linux and sunos, not on osx.

@isaacs isaacs added a commit that closed this issue Jun 4, 2012
@isaacs isaacs Revert "build: target OSX 10.5 when building on darwin"
This reverts commit b6d6a54,
which fixed #3072, so we'll have to figure out another way
to make that work.
93eca95
@isaacs isaacs closed this in 93eca95 Jun 4, 2012
@TooTallNate TooTallNate reopened this Jun 12, 2012
@TooTallNate

Still happens as of v0.7.10:

$ node -v
v0.7.10
$ node < /dev/tty
> Assertion failed: (!!(events & UV__IO_READ) ^ !!(events & UV__IO_WRITE)), function uv__stream_io, file ../deps/uv/src/unix/stream.c, line 732.
Abort trap: 6
@TooTallNate

git bisect says that nodejs/node-v0.x-archive@37fd953 (a.k.a joyent/libuv@3c41597) broke it again.

@TooTallNate TooTallNate referenced this issue in asyncly/cdir Jun 16, 2012
Merged

piping support #22

@bnoordhuis
Member

@TooTallNate Sorry, I kind of lost track of this issue. Does it still happen?

@TooTallNate

Yes, still happens. I'll ship you a six pack of beer to fix it ;)

On Wednesday, July 4, 2012, Ben Noordhuis wrote:

@TooTallNate Sorry, I kind of lost track of this issue. Does it still
happen?


Reply to this email directly or view it on GitHub:
#3072 (comment)

@bnoordhuis bnoordhuis was assigned Jul 4, 2012
@bnoordhuis
Member

Deal. :-) I'll work on it next week - I sent my old MBP back to Joyent and I haven't bought a new one yet.

@brntbeer
brntbeer commented Aug 7, 2012

👍 for @bnoordhuis to fix it 3 weeks ago

@chewbranca

Ran into this as well on OSX 10.7. Would love to see this fixed!

@indutny
Member
indutny commented Aug 17, 2012

Fix is there, still polishing it out: https://github.com/joyent/libuv/pull/528/files

@TooTallNate

Fixed in master.

This was referenced Oct 30, 2012
@TooTallNate

So I guess @indutny's select() stuff got reverted? This happens again now with v0.9.4.

@TooTallNate TooTallNate reopened this Jan 2, 2013
@indutny
Member
indutny commented Jan 2, 2013

Ah, no. it doesn't.

@indutny
Member
indutny commented Jan 2, 2013
@TooTallNate

Works as expected in node v0.10.7 (just the version I was on at the moment, it's probably been fixed for a while). Closing.

@TooTallNate TooTallNate closed this Jun 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment