diff options
author | Anthony Pesch <inolen@gmail.com> | 2013-09-03 02:54:22 -0700 |
---|---|---|
committer | Anthony Pesch <inolen@gmail.com> | 2013-09-03 02:54:22 -0700 |
commit | 9451cadc83111807b610ea8cefe798cc8cfb37f1 (patch) | |
tree | 2f22c8ab5ac98db66ad3e5ddc9a75e4362539fc2 | |
parent | 02cfae8fdda8f6916ae12c6cda947a7aa2084014 (diff) |
disable node stdin fixes due to side effects
-rw-r--r-- | src/library_tty.js | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/library_tty.js b/src/library_tty.js index 53239989..bf4a2472 100644 --- a/src/library_tty.js +++ b/src/library_tty.js @@ -6,23 +6,25 @@ mergeInto(LibraryManager.library, { $TTY: { ttys: [], init: function () { - if (ENVIRONMENT_IS_NODE) { - // currently, FS.init does not distinguish if process.stdin is a file or TTY - // device, it always assumes it's a TTY device. because of this, we're forcing - // process.stdin to UTF8 encoding to at least make stdin reading compatible - // with text files until FS.init can be refactored. - process['stdin']['setEncoding']('utf8'); - } + // https://github.com/kripken/emscripten/pull/1555 + // if (ENVIRONMENT_IS_NODE) { + // // currently, FS.init does not distinguish if process.stdin is a file or TTY + // // device, it always assumes it's a TTY device. because of this, we're forcing + // // process.stdin to UTF8 encoding to at least make stdin reading compatible + // // with text files until FS.init can be refactored. + // process['stdin']['setEncoding']('utf8'); + // } }, shutdown: function() { - if (ENVIRONMENT_IS_NODE) { - // inolen: any idea as to why node -e 'process.stdin.read()' wouldn't exit immediately (with process.stdin being a tty)? - // isaacs: because now it's reading from the stream, you've expressed interest in it, so that read() kicks off a _read() which creates a ReadReq operation - // inolen: I thought read() in that case was a synchronous operation that just grabbed some amount of buffered data if it exists? - // isaacs: it is. but it also triggers a _read() call, which calls readStart() on the handle - // isaacs: do process.stdin.pause() and i'd think it'd probably close the pending call - process['stdin']['pause'](); - } + // https://github.com/kripken/emscripten/pull/1555 + // if (ENVIRONMENT_IS_NODE) { + // // inolen: any idea as to why node -e 'process.stdin.read()' wouldn't exit immediately (with process.stdin being a tty)? + // // isaacs: because now it's reading from the stream, you've expressed interest in it, so that read() kicks off a _read() which creates a ReadReq operation + // // inolen: I thought read() in that case was a synchronous operation that just grabbed some amount of buffered data if it exists? + // // isaacs: it is. but it also triggers a _read() call, which calls readStart() on the handle + // // isaacs: do process.stdin.pause() and i'd think it'd probably close the pending call + // process['stdin']['pause'](); + // } }, register: function(dev, ops) { TTY.ttys[dev] = { input: [], output: [], ops: ops }; |