remove backward compat tty helpers.
This commit is contained in:
parent
b4fb673943
commit
af2a42423b
|
@ -156,41 +156,3 @@ helpers.__defineGetter__('Element', function() {
|
|||
}
|
||||
return helpers._element;
|
||||
});
|
||||
|
||||
helpers.isTTY = function(stream) {
|
||||
if (stream.isTTY) {
|
||||
return true;
|
||||
}
|
||||
if (stream.fd != null) {
|
||||
return require('tty').isatty(stream.fd);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
helpers.hasRaw = function(stream, value) {
|
||||
return !!stream.setRawMode
|
||||
|| (stream === process.stdin)
|
||||
|| !!(stream._handle && stream._handle.setRawMode && stream.readable);
|
||||
};
|
||||
|
||||
helpers.setRawMode = function(stream, value) {
|
||||
if (stream.setRawMode) {
|
||||
return stream.setRawMode(value);
|
||||
}
|
||||
if (stream === process.stdin) {
|
||||
stream._blessedRaw = value;
|
||||
return require('tty').setRawMode(value);
|
||||
}
|
||||
if (stream._handle && stream._handle.setRawMode && stream.readable) {
|
||||
stream._blessedRaw = value;
|
||||
return stream._handle.setRawMode(value);
|
||||
}
|
||||
throw new Error('Could not set raw mode.');
|
||||
};
|
||||
|
||||
helpers.isRaw = function(stream) {
|
||||
if (stream.isRaw != null) {
|
||||
return stream.isRaw;
|
||||
}
|
||||
return !!stream._blessedRaw;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue