diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-01-10 17:25:48 -0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-01-10 17:25:48 -0800 |
commit | b9cfd9527acad0a686083078863bff028dfd785a (patch) | |
tree | 0fe2ddeb92e94e2b9f9f711a28f214503df69509 /lib | |
parent | 63bd237892e989dd41362058ff1ba8548b770535 (diff) | |
download | node-new-b9cfd9527acad0a686083078863bff028dfd785a.tar.gz |
getWindowSize/setWindowSize
Diffstat (limited to 'lib')
-rw-r--r-- | lib/readline.js | 7 | ||||
-rw-r--r-- | lib/tty.js | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/readline.js b/lib/readline.js index d08cc5c13a..b52994c3fb 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -49,11 +49,14 @@ function Interface(output, completer) { this.history = []; this.historyIndex = -1; - exports.columns = tty.getColumns(); + // 0 for stdin + var winSize = tty.getWindowSize(0); + exports.columns = winSize[1]; if (process.listeners('SIGWINCH').length === 0) { process.on('SIGWINCH', function() { - exports.columns = tty.getColumns(); + var winSize = tty.getWindowSize(0); + exports.columns = winSize[1]; }); } } diff --git a/lib/tty.js b/lib/tty.js index 714031b2c9..5cdd088e8b 100644 --- a/lib/tty.js +++ b/lib/tty.js @@ -4,7 +4,8 @@ var binding = process.binding('stdio'); exports.isatty = binding.isatty; exports.setRawMode = binding.setRawMode; -exports.getColumns = binding.getColumns; +exports.getWindowSize = binding.getWindowSize; +exports.setWindowSize = binding.setWindowSize; exports.open = function(path, args) { |