jqueryjquery-eventsjquery-terminal

Disable keyboard shortcuts (was: Leave focus from keyboard)


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.


Solution

  • You can disable shortcuts using option keydown:

    .terminal(..., {
        keydown: function(e) {
            if (e.which === 76 && e.ctrlKey) { // CTRL+L
                return true;
            }
        }
    });