Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

tiny fixes in tty_posix.js

Close #1158
Close #1160
Close #1252
  • Loading branch information...
commit 99b210d7eaca6d0bf8731b338ce0a32d9df1e493 1 parent e286480
@xenyou xenyou authored isaacs committed
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/tty_posix.js
View
6 lib/tty_posix.js
@@ -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');
Please sign in to comment.
Something went wrong with that request. Please try again.