How to use the node-pty.native function in node-pty

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

github xtermjs / xterm.js / src / Terminal.integration.ts View on Github external
}
  return result;
}

// Skip tests on Windows since pty.open isn't supported
if (os.platform() !== 'win32') {
  const CONSOLE_LOG = console.log;

  // expect files need terminal at 80x25!
  const COLS = 80;
  const ROWS = 25;

  /** some helpers for pty interaction */
  // we need a pty in between to get the termios decorations
  // for the basic test cases a raw pty device is enough
  primitivePty = pty.native.open(COLS, ROWS);

  /** tests */
  describe('xterm output comparison', () => {
    let xterm;

    beforeEach(() => {
      xterm = new Terminal({ cols: COLS, rows: ROWS });
      xterm.refresh = () => {};
      xterm.viewport = {
        syncScrollArea: () => {}
      };
    });

    // omit stack trace for escape sequence files
    Error.stackTraceLimit = 0;
    const files = glob.sync('**/escape_sequence_files/*.in', { cwd: path.join(__dirname, '..')});
github kaiakz / walv / lib / xterm / lib / Terminal.integration.js View on Github external
for (var line = term.buffer.ybase; line < term.buffer.ybase + term.rows; line++) {
        lineText = '';
        for (var cell = 0; cell < term.cols; ++cell) {
            lineText += term.buffer.lines.get(line).loadCell(cell, new BufferLine_1.CellData()).getChars() || BufferLine_1.WHITESPACE_CELL_CHAR;
        }
        lineText = lineText.replace(/\s+$/, '');
        result += lineText;
        result += '\n';
    }
    return result;
}
if (os.platform() !== 'win32') {
    var consoleLog_1 = console.log;
    var cols_1 = 80;
    var rows_1 = 25;
    primitivePty = pty.native.open(cols_1, rows_1);
    describe('xterm output comparison', function () {
        this.timeout(10000);
        var xterm;
        beforeEach(function () {
            xterm = new TestTerminal({ cols: cols_1, rows: rows_1 });
            xterm.refresh = function () { };
            xterm.viewport = {
                syncScrollArea: function () { }
            };
        });
        Error.stackTraceLimit = 0;
        var files = glob.sync('**/escape_sequence_files/*.in', { cwd: path.join(__dirname, '..') });
        var skip = [
            10, 16, 17, 19, 32, 33, 34, 35, 36, 39,
            40, 42, 43, 44, 45, 46, 47, 48, 49, 50,
            51, 52, 54, 55, 56, 57, 58, 59, 60, 61,

node-pty

Fork pseudoterminals in Node.JS

MIT
Latest version published 1 year ago

Package Health Score

75 / 100
Full package analysis

Similar packages