mirror of https://github.com/nodejs/node.git
parent
e286480e34
commit
99b210d7ea
|
@ -71,14 +71,14 @@ function ReadStream(fd) {
|
|||
} else {
|
||||
// Nobody's watching anyway
|
||||
self.removeListener('data', onData);
|
||||
self.on('newlistener', onNewListener);
|
||||
self.on('newListener', onNewListener);
|
||||
}
|
||||
}
|
||||
|
||||
function onNewListener(event) {
|
||||
if (event == 'keypress') {
|
||||
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')
|
||||
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');
|
||||
} else {
|
||||
this.write('\x1b[' + (y + 1) + ';' + (x + 1) + 'H');
|
||||
|
|
Loading…
Reference in New Issue