How to use the xterm/dist/xterm.js 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 gagarinjs / meteor-mocha / packages / gagarin-mocha-reporter / lib / reporter.js View on Github external
Template.reporter.onRendered(function () {
  const xterm = new Terminal({
    cols: this.nColumns.get(),
    rows: 40,
    convertEol: true,
    cursorBlink: true,
    scrollback: 2048,
  });

  let processing = false;
  this.resize = () => {
    if (!processing) {
      setTimeout(() => {
        xterm.fit();
        xterm.showCursor();
        this.needsRedraw.changed();
        processing = false;
      }, 50);
github cloudfoundry / stratos / src / frontend / app / shared / components / ssh-viewer / ssh-viewer.component.ts View on Github external
if (!this.connectionStatus) {
      return;
    }

    this.connectSubscription = this.connectionStatus.subscribe((count: number) => {
      this.isConnected = (count !== 0);
      if (this.isConnected) {
        this.xterm.focus();
        this.isConnecting = false;
      }
      if (!this.isDestroying) {
        this.changeDetector.detectChanges();
      }
    });

    this.xterm = new Terminal({
      cols: 80,
      rows: 40
    });

    this.xterm.open(this.container.nativeElement, false);
    this.xterm.on('data', this.onTermSendData);
    this.xterm.on('resize', this.onTermResize);

    this.reconnect();
  }
github cloudfoundry / stratos / src / app / shared / components / ssh-viewer / ssh-viewer.component.ts View on Github external
if (!this.connectionStatus) {
      return;
    }

    this.connectSubscription = this.connectionStatus.subscribe((count: number) => {
      this.isConnected = (count !== 0);
      if (this.isConnected) {
        this.xterm.focus();
        this.isConnecting = false;
      }
      if (!this.isDestroying) {
        this.changeDetector.detectChanges();
      }
    });

    this.xterm = new Terminal({
      cols: 80,
      rows: 40
    });

    this.xterm.open(this.container.nativeElement, false);
    this.xterm.on('data', this.onTermSendData);
    this.xterm.on('resize', this.onTermResize);

    this.reconnect();
  }