mirror of
https://github.com/nodejs/node-v0.x-archive.git
synced 2026-04-28 03:01:10 -04:00
Add SIGWINCH handler for readline
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user