xterm.js: Uncaught TypeError: Cannot set property '0' of undefined

execute vi / vim command throw exception

error: Uncaught TypeError: Cannot set property ‘0’ of undefined

debug: Serial port requested application keypad.

code: <script src="/static/plugins/xterm/src/xterm.js"></script> <link rel="stylesheet" href="/static/plugins/xterm/src/xterm.css">

    var currentWs = new ReconnectingWebSocket('ws://{{ wsServer }}/ws/terminal/current');
    currentWs.onopen =  function(event) {
        var xterm = new Terminal({
            geometry: [98, 26],
            debug: true
        });
        xterm.open(document.getElementById('currentRecord'));
        currentWs.onmessage = function(event) {
            xterm.write(event.data);
        }; 
    }

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Looks like this.lines or this.lines[this.y + this.ybase] is undefined. You’d have to inspect both to see what is wrong here, either with printf-debugging (console.log) or with a breakpoint at xterm.js:1603.

I guess your xterm geometry is not in sync with the pty, since vi is trying to set the y scroll margins to 0 and 29 ([1;30r in your second vi output line).