How to use the xterm.Terminal.prototype function in xterm

To help you get started, we’ve selected a few xterm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github astefanutti / kubebox / lib / ui / xterm / terminal.js View on Github external
'use strict';

const { Terminal } = require('xterm');

Terminal.prototype.resize = function (x, y) {
    if (isNaN(x) || isNaN(y)) {
        return;
    }
    if (x === this.cols && y === this.rows) {
        // PATCH BEGIN https://github.com/xtermjs/xterm.js/issues/1278
        if (this.charMeasure) { 
            if (!this.charMeasure.width || !this.charMeasure.height) {
                this.charMeasure.measure(this.options);
            }
        }
        // PATCH END
        return;
    }
    if (x < 1)
        x = 1;
    if (y < 1)