Skip to content

Commit

Permalink
update the "columns" and "rows" properties when the console gets resized
Browse files Browse the repository at this point in the history
for node >= v0.7.9 I'm pretty sure
  • Loading branch information
TooTallNate committed Jun 21, 2012
1 parent 4ef4f66 commit 2bf1579
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,12 @@ if (tty.isatty(1)) {
if (exports.stdout._handle && exports.stdout._handle.unref) {
exports.stdout._handle.unref()
}

// Update the "columns" and "rows" properties on the stdout stream
// whenever the console window gets resized.
if (exports.stdout._refreshSize) {
process.on('SIGWINCH', function () {
exports.stdout._refreshSize()
})
}
}

0 comments on commit 2bf1579

Please sign in to comment.