Key Bindings
Harlequin can only react to key presses that are sent to it from the Terminal it is running in. Some common key presses, like ctrl+enter, arenât forwarded correctly by some terminals, or may be aliased to a different key or even a different sort of event.
If you donât want to upgrade your terminal, you can use the following aliases, which should be supported everywhere (if not, open an issue):
- Run query: use ctrl+j, not ctrl+enter.
- Comment line: use ctrl+_ (underscore), not ctrl+/.
- On a Mac: For all bindings, use ^ Control, not â Command.
- On MacOs >= 15.0.0 , the key binding ^+enter is mapped to âShow contextual menuâ by default. This interferes with the âRun Queryâ key binding of Harlequin. Instead of setting up alternative key bindings, you can disable this shortcut in MacOS by navigating to: System Settings -> Keyboard -> Keyboard Shortcuts⊠-> Keyboard -> turn âShow contextual menuâ off.
See here for copy and paste.
Finally, Harlequinâs footer, which lists some of the currently-active key bindings, is clickable. If a binding isnât working, you can click it in the footer to take the same action.
Enabling Key Bindings in VS Code Terminal
VS Code intercepts a large number of key presses before they make it to the terminal, even when the terminal is focused. This includes ctrl+j (which hides or shows the VS Code terminal!). Fortunately, you can change this behavior in the VS Code settings. If you use a settings.json
file, you can add this snippet:
{
"terminal.integrated.allowChords": false,
"terminal.integrated.sendKeybindingsToShell": true,
}
Otherwise, you can press F1 to open the command palette, then type and select âTerminal: Configure Terminal Settingsâ. Then make the following changes:
- Uncheck the option âTerminal > Integrated: Allow Chordsâ
- Check the option âTerminal > Integrated: Send Keybindings to Shellâ (you may have to scroll down nearly all the way).