Windows: fix window size getter bug

This commit is contained in:
Bert Belder 2011-01-19 05:55:02 +01:00 committed by Ryan Dahl
parent f0bf325495
commit e6e6e87463
3 changed files with 3 additions and 5 deletions

View File

@ -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 File

@ -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 File

@ -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;
}
}