mirror of https://github.com/nodejs/node.git
parent
e286480e34
commit
99b210d7ea
|
@ -71,14 +71,14 @@ function ReadStream(fd) {
|
||||||
} else {
|
} else {
|
||||||
// Nobody's watching anyway
|
// Nobody's watching anyway
|
||||||
self.removeListener('data', onData);
|
self.removeListener('data', onData);
|
||||||
self.on('newlistener', onNewListener);
|
self.on('newListener', onNewListener);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onNewListener(event) {
|
function onNewListener(event) {
|
||||||
if (event == 'keypress') {
|
if (event == 'keypress') {
|
||||||
self.on('data', onData);
|
self.on('data', onData);
|
||||||
self.removeListener('newlistener', onNewListener);
|
self.removeListener('newListener', onNewListener);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -331,7 +331,7 @@ WriteStream.prototype.cursorTo = function(x, y) {
|
||||||
if (typeof x !== 'number')
|
if (typeof x !== 'number')
|
||||||
throw new Error("Can't set cursor row without also setting it's column");
|
throw new Error("Can't set cursor row without also setting it's column");
|
||||||
|
|
||||||
if (typeof x === 'number') {
|
if (typeof y !== 'number') {
|
||||||
this.write('\x1b[' + (x + 1) + 'G');
|
this.write('\x1b[' + (x + 1) + 'G');
|
||||||
} else {
|
} else {
|
||||||
this.write('\x1b[' + (y + 1) + ';' + (x + 1) + 'H');
|
this.write('\x1b[' + (y + 1) + ';' + (x + 1) + 'H');
|
||||||
|
|
Loading…
Reference in New Issue