Gra
Gra

Reputation: 1594

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.

Upvotes: 1

Views: 179

Answers (1)

jcubic
jcubic

Reputation: 66490

You can disable shortcuts using option keydown:

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

Upvotes: 1

Related Questions