如何在 VS Code 中使用“ctrl + shift + n”打开一个连接到 WSL 的新窗口?

问题描述 投票:0回答:1

当我在 VS Code 中时,我希望能够按“ctrl + shift + n”并获得一个连接到 WSL 的新窗口。

我有 WSL 扩展。

我知道我可以将

--remote wsl+Ubuntu
添加到 Windows 快捷方式目标,但这不会影响 VS Code 中的快捷方式。

将“ctrl + shift + n”重新绑定到“WSL:在新窗口中连接”不起作用。

visual-studio-code keyboard-shortcuts windows-subsystem-for-linux
1个回答
0
投票

在 VS Code -“文件”/“首选项”中,选择“键盘快捷键”。这将打开“keybindings.json”文件。

在右侧窗格(您的自定义键绑定)中,添加以下代码:

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

保存文件。

© www.soinside.com 2019 - 2024. All rights reserved.