Keybindings not working from VSCode integrated terminal

Viewed 266

I'm attempting to map the vscode commands workbench.action.navigateLeft and workbench.action.navigateRight to alt+i and alt+o, respectively. This was pretty straightforward with the following changes to keybindings.json:

{
  "key": "alt+o",
  "command": "workbench.action.navigateRight"
},
{
  "key": "alt+i",
  "command": "workbench.action.navigateLeft"
},

This works perfectly when I'm in the context of editors, but does not work when my focus is on the integrated terminal. I've added these two commands to terminal.integrated.commandsToSkipShell in settings.json but that seemed to have no effect. Nothing happens when I press alt+i or alt+o from within the integrated terminal.

"terminal.integrated.commandsToSkipShell": [
  "workbench.action.navigateLeft",
  "workbench.action.navigateRight"
]

I'm on a linux system using bash as my shell. It seems like maybe bash is capturing my keystrokes before vscode has the opportunity to interpret them, but I don't know how to verify if that's happening or how to change it if it is. Any help would be appreciated.

1 Answers

The problem ended up being with a different setting in my settings.json file. I had terminal.integrated.sendKeyBindingsToShell set to true which was intercepting some commands before they could be received by vscode.

This makes sense given the description of that setting. Setting this value to false (or removing from my settings.json file as the default is false) caused my key bindings to work as expected.

Related