1

Is there a way to leave the terminal from the keyboard?
In an html page, I'm used to CTRL+L to type an URL, but the only result is a clearing of the console. I'd like to be able to CTRL+L directly, but that would be ok with a combination of keys to execute before.

A suggestion BTW, do not call term.clear() when onClear is defined for a maximum control (like disabling clearing with CTRL+L.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Gra
  • 1,542
  • 14
  • 28

1 Answers1

1

You can disable shortcuts using option keydown:

.terminal(..., {
    keydown: function(e) {
        if (e.which === 76 && e.ctrlKey) { // CTRL+L
            return true;
        }
    }
});
jcubic
  • 61,973
  • 54
  • 229
  • 402