mirror of https://github.com/nodejs/node.git
Add SIGWINCH handler for readline
parent
678fa31136
commit
0ef8a86af2
|
@ -46,15 +46,21 @@ function Interface (output, completer) {
|
||||||
|
|
||||||
this.history = [];
|
this.history = [];
|
||||||
this.historyIndex = -1;
|
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);
|
inherits(Interface, EventEmitter);
|
||||||
|
|
||||||
Interface.prototype.__defineGetter__("columns", function () {
|
Interface.prototype.__defineGetter__("columns", function () {
|
||||||
if (this.enabled) {
|
return exports.columns;
|
||||||
return stdio.getColumns();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Interface.prototype.setPrompt = function (prompt, length) {
|
Interface.prototype.setPrompt = function (prompt, length) {
|
||||||
|
|
Loading…
Reference in New Issue