-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
added stubs for tcgetattr and tcsetattr, minor node tty fixes #1555
Conversation
Any chance for a test here? :) |
I'll write up some tests later today, sure. |
Writing the tests for the tty ended up being more work than I'd planned. I decided to make A few minor fixes had to be made to the tty library in order to support reading from text files that were piped to stdin. Currently, the FS startup code doesn't distinguish if stdin is a tty device or not (it always assumes it's a tty device), so the tty library now forces process.stdin to be utf8 encoded. This makes reading from text files work, but really there should be some refactoring to the standard stream initialization such that the TTY device isn't being used when stdin represents a file. Also, there was a really nasty issue where if you read only once from stdin the process would hang in node, I left a short IRC transcript from node's streams author in there explaining the "fix." Finally, I hit a few snags in libc calls:
|
Does test_stdin still work on spidermonkey? Let's loop on spidermonkey and node to test both. |
Err, I went to try and run it in SM but got errors about setTimeout not being defined:
If this is true (does SM shell not implement an event loop?) I guess I can update the test to manually call main_loop once before hitting |
Updated the test to work in SM shell, let me know if that comment is incorrect. Do you want the test runner code to manually iterate over both engines? |
Yeah, just loop over |
Yes, no async stuff in sm shell. |
Needs a rebase, says it can't be merged. |
- added fixes for tty get_char in the node environment
- made test_stdin async to work in the node environment - clearerr should reset both eof and error indicators - fgetc was incorrectly setting the eof indicator. in cases where fread had errored with EAGAIN it was setting eof. I removed the set entirely, as there is no need for fgetc to even worry about it, fread will set the correct value in any case
Rebased, |
added stubs for tcgetattr and tcsetattr, minor node tty fixes
test_stdin does not pass for me in node, i had to disable it. I get |
K, I'll take a look in my VM today. The code in the TTY modules feels kind of bad, but I'd like to get it resolved in node. |
While this fixed a few issues, it also created a new issue where Python is exiting with EAGAIN when piping the output during the test runner. You'll notice it when a test fails and all you see is:
For whatever reason, by simply referencing process.stdin, e.g.:
node does something such that reading from its stdout is returning EAGAIN instead of blocking. Pushed a fix disabling |
Posted an issue in the node issue queue regarding this: |
...