Browse Source

Add SIGWINCH handler for readline

v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
0ef8a86af2
  1. 12
      lib/readline.js

12
lib/readline.js

@ -46,15 +46,21 @@ function Interface (output, completer) {
this.history = [];
this.historyIndex = -1;
exports.columns = process.binding('stdio').getColumns();
if (process.listeners("SIGWINCH").length === 0) {
process.on("SIGWINCH", function () {
exports.columns = process.binding('stdio').getColumns();
});
}
}
}
inherits(Interface, EventEmitter);
Interface.prototype.__defineGetter__("columns", function () {
if (this.enabled) {
return stdio.getColumns();
}
return exports.columns;
});
Interface.prototype.setPrompt = function (prompt, length) {

Loading…
Cancel
Save