jquery.terminal
jquery.terminal copied to clipboard
browser keypresses such as function buttons are cancelled when term input is paused
Issue summary
when term.pause(true) f11 doesnt work to go fullscreen, is it just me?
Expected behavior
should not prevent All keypresses
Steps to reproduce
term.pause(true) try f11
Browser and OS
all chrome, edge on windows
I can reproduce, thanks for the report
When paused, all key shortcuts are blocked, except CTRL+D that unpause the terminal. Keys are blocked only when terminal is in focus.
You can disable this by using:
$('body').terminal({}, {
pauseEvents: false,
keydown() {
return true;
}
});
When paused, all key shortcuts are blocked, except CTRL+D that unpause the terminal. Keys are blocked only when terminal is in focus.
You can disable this by using:
$('body').terminal({}, { pauseEvents: false, keydown() { return true; } });
I tried this code and when the terminal is Not paused some keys like enter, backspace and up and down arrow keys are none responsive
You're right, didn't check the Cmd plugin, when keydown returns anything non-undefined, the rest of the code is not executed. You need to check if the terminal is paused:
$('body').terminal({}, {
pauseEvents: false,
keydown() {
if (this.paused()) {
return true;
}
}
});
And if you want to allow CTRL+D to unpause and cancel AJAX requests you need:
const term = $('body').terminal({}, {
pauseEvents: false,
keydown(e) {
if (this.paused() && !(e.key === 'D' && e.ctrlKey)) {
return true;
}
}
});
That works perfectly. Thanks so much for your help!:)