Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

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

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

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

TooTallNate opened this issue Apr 7, 2012 · 20 comments
Assignees

Comments

@TooTallNate
Copy link

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
Copy link
Author

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

@isaacs
Copy link

isaacs commented Apr 9, 2012

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

@TooTallNate
Copy link
Author

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
Copy link
Author

Appears to be fixed now.

@TooTallNate
Copy link
Author

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
Copy link
Member

@TooTallNate: WFM. To wit:

$ out/Debug/node < /dev/tty
> 1+1
2
> 2+2
4

@isaacs
Copy link

isaacs commented May 27, 2012

It works on linux and sunos, not on osx.

@isaacs isaacs closed this as completed in 93eca95 Jun 4, 2012
@TooTallNate TooTallNate reopened this Jun 12, 2012
@TooTallNate
Copy link
Author

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
Copy link
Author

git bisect says that 37fd953 (a.k.a joyent/libuv@3c41597) broke it again.

@bnoordhuis
Copy link
Member

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

@TooTallNate
Copy link
Author

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)

@ghost ghost assigned bnoordhuis Jul 4, 2012
@bnoordhuis
Copy link
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
Copy link

brntbeer commented Aug 7, 2012

👍 for @bnoordhuis to fix it 3 weeks ago

@chewbranca
Copy link

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

@indutny
Copy link
Member

indutny commented Aug 17, 2012

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

@TooTallNate
Copy link
Author

Fixed in master.

@TooTallNate
Copy link
Author

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
Copy link
Member

indutny commented Jan 2, 2013

Ah, no. it doesn't.

@indutny
Copy link
Member

indutny commented Jan 2, 2013

See joyent/libuv#674

@TooTallNate
Copy link
Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants