Merge branch 'utf32_buffer' into utf8_input

This commit is contained in:
Jörg Breitbart
2019-01-31 23:32:48 +01:00
23 changed files with 1775 additions and 343 deletions
+7 -4
View File
@@ -69,6 +69,9 @@ const WRITE_BUFFER_PAUSE_THRESHOLD = 5;
*/
const WRITE_BATCH_SIZE = 300;
const MINIMUM_COLS = 2; // Less than 2 can mess with wide chars
const MINIMUM_ROWS = 1;
/**
* The set of options that only have an effect when set in the Terminal constructor.
*/
@@ -262,8 +265,8 @@ export class Terminal extends EventEmitter implements ITerminal, IDisposable, II
// TODO: WHy not document.body?
this._parent = document ? document.body : null;
this.cols = this.options.cols;
this.rows = this.options.rows;
this.cols = Math.max(this.options.cols, MINIMUM_COLS);
this.rows = Math.max(this.options.rows, MINIMUM_ROWS);
if (this.options.handler) {
this.on('data', this.options.handler);
@@ -1710,8 +1713,8 @@ export class Terminal extends EventEmitter implements ITerminal, IDisposable, II
return;
}
if (x < 1) x = 1;
if (y < 1) y = 1;
if (x < MINIMUM_COLS) x = MINIMUM_COLS;
if (y < MINIMUM_ROWS) y = MINIMUM_ROWS;
this.buffers.resize(x, y);