mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-09 10:42:02 +00:00
allow any kind of stream as input and output. fixes #138.
This commit is contained in:
parent
983b5a745a
commit
8228142060
@ -318,7 +318,7 @@ Program.prototype.listen = function() {
|
|||||||
this.on('newListener', function fn(type) {
|
this.on('newListener', function fn(type) {
|
||||||
if (type === 'keypress' || type === 'mouse') {
|
if (type === 'keypress' || type === 'mouse') {
|
||||||
self.removeListener('newListener', fn);
|
self.removeListener('newListener', fn);
|
||||||
if (!self.input.isRaw) {
|
if (self.input.setRawMode && !self.input.isRaw) {
|
||||||
self.input.setRawMode(true);
|
self.input.setRawMode(true);
|
||||||
self.input.resume();
|
self.input.resume();
|
||||||
}
|
}
|
||||||
@ -3971,13 +3971,17 @@ Program.prototype.pause = function(callback) {
|
|||||||
|
|
||||||
var write = this.output.write;
|
var write = this.output.write;
|
||||||
this.output.write = function() {};
|
this.output.write = function() {};
|
||||||
this.input.setRawMode(false);
|
if (this.input.setRawMode) {
|
||||||
|
this.input.setRawMode(false);
|
||||||
|
}
|
||||||
this.input.pause();
|
this.input.pause();
|
||||||
|
|
||||||
return this._resume = function() {
|
return this._resume = function() {
|
||||||
delete self._resume;
|
delete self._resume;
|
||||||
|
|
||||||
self.input.setRawMode(true);
|
if (self.input.setRawMode) {
|
||||||
|
self.input.setRawMode(true);
|
||||||
|
}
|
||||||
self.input.resume();
|
self.input.resume();
|
||||||
self.output.write = write;
|
self.output.write = write;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user