diff --git a/lib/program.js b/lib/program.js index 2634f20..54f7a08 100644 --- a/lib/program.js +++ b/lib/program.js @@ -17,6 +17,8 @@ var Tput = require('./tput') , colors = require('./colors') , slice = Array.prototype.slice; +var nextTick = global.setImmediate || process.nextTick.bind(process); + /** * Program */ @@ -1283,7 +1285,7 @@ Program.prototype._buffer = function(text) { this._buf = text; - process.nextTick(this._flush); + nextTick(this._flush); }; Program.prototype.flush = function(text) { diff --git a/lib/widget.js b/lib/widget.js index a2d13de..8313264 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -6496,7 +6496,7 @@ function Terminal(options) { }); this.on('resize', function() { - setImmediate(function() { + nextTick(function() { self.term.resize(self.width - self.iwidth, self.height - self.iheight); }); });