'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 1:[1]

You can disable shortcuts using option keydown:

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 jcubic