aboutsummaryrefslogtreecommitdiff
path: root/src/library_tty.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/library_tty.js')
-rw-r--r--src/library_tty.js32
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 };