Permalink
Browse files

Windows: fix window size getter bug

  • Loading branch information...
1 parent f0bf325 commit e6e6e87463d4b1d3d8d5c129e4d008d35a1b5463 @piscisaureus piscisaureus committed with ry Jan 19, 2011
Showing with 3 additions and 5 deletions.
  1. +1 −1 lib/readline.js
  2. +1 −1 lib/tty_win32.js
  3. +1 −3 src/node_stdio_win32.cc
View
@@ -54,7 +54,7 @@ function Interface(output, completer) {
if (process.listeners('SIGWINCH').length === 0) {
process.on('SIGWINCH', function() {
- var winSize = tty.getWindowSize(0);
+ var winSize = tty.getWindowSize(output.fd);
exports.columns = winSize[1];
});
}
View
@@ -27,7 +27,7 @@ function ReadStream(fd) {
self.emit('data', dataUseString ? char : new Buffer(char, 'utf-8'));
}
}
- function onResize(h, w) {
+ function onResize() {
process.emit('SIGWINCH');
}
View
@@ -546,10 +546,8 @@ static void tty_poll(EV_P_ ev_async *watcher, int revents) {
case WINDOW_BUFFER_SIZE_EVENT:
if (!tty_resize_callback)
break;
- argv[0] = Integer::New(input.Event.WindowBufferSizeEvent.dwSize.Y);
- argv[1] = Integer::New(input.Event.WindowBufferSizeEvent.dwSize.X);
callback = cb_unwrap(tty_resize_callback);
- (*callback)->Call(global, 2, argv);
+ (*callback)->Call(global, 0, argv);
break;
}
}

0 comments on commit e6e6e87

Please sign in to comment.