 if (this.historyIndex > 0) {
                        this.historyIndex -= 1;
                    }
                    this.input = this.historyBuffer[this.historyIndex];
                    this.cursorHome(false);
                    this.clearLine();
                    this.xterm.write(this.input);
                    this.cursorPosition = this.input.length;
                }

                historyForward() {
                    if (this.history.length === 0 || this.historyIndex === -1) {
            