visual-studio-codekeyboard-shortcutswindows-subsystem-for-linux

How do I make "ctrl + shift + n" in VS Code open a new window connected to WSL?


When I'm in VS Code I want to be able to press "ctrl + shift + n" and get a new window that's connected to WSL.

I have the WSL extension.

I'm aware I can add --remote wsl+Ubuntu to the Windows shortcut target, but that doesn't affect the shortcut in VS Code.

Rebinding "ctrl + shift + n" doesn't work with any of the following, with or without "terminalFocus",


  {
    "key": "ctrl+shift+n",
    "command": "wsl.openInNewWindow",
    "when": "terminalFocus"
  }

  {
    "key": "ctrl+shift+n",
    "command": "remote-wsl.explorer.openDistroInCurrentWindow"
  }

  {
    "key": "ctrl+shift+n",
    "command": "remote-wsl.explorer.connectInNewWindow"
  }

Image showing the key bind doesn't work


Solution

  • You need to change the keybinding of remote-wsl.newWindow, like what I've done here for shift+alt+N:

    on this link