英文:
Why does Ctrl + Shift + C no longer open a new external terminal in VS Code?
问题
以下是已翻译的内容:
这里有证明我的VS Code 已配置为接受<kbd>Ctrl + Shift + C</kbd>以打开一个新的外部终端:
如果我重新绑定它为<kbd>Ctrl + Shift + X</kbd>,这个热键仍然失效。
<kbd>Ctrl + Shift + Q</kbd>仍然会在Ubuntu终端中以root权限打开一个终端。我怀疑VS Code注册了这个热键,但Ubuntu不允许它打开终端。例如:<kbd>Ctrl + Shift + L</kbd>仍然选择整行。<kbd>Ctrl + ~</kbd>仍然打开终端。
但是,我也没有故意更改这方面的任何内容:它在两周前是有效的。我可以重新安装整个操作系统和所有软件,但我不想这样做。
我的terminal.external.linuxExec
设置为x-terminal-emulator
。如果我将其更改为gnome-terminal
,问题仍然会重现。当绑定到不同命令,比如cursorDown
时,<kbd>ctrl+shift+c</kbd>可以工作。我使用的是Ubuntu 22.04.2 LTS。
我每天都使用这个热键,所以它现在无法工作对我的生产力是有代价的。如果不修复它,这意味着每次我想在当前项目中打开一个新终端时,我都必须:打开一个新的根终端,然后键入/code/subfolder/projectName
。
英文:
Here is proof my VS Code is configured to accept <kbd>Ctrl + Shift + C</kbd> to open a new external terminal:
Here is proof that nothing overwrites the hotkey in VS Code:
The hotkey still fails if I rebind it to <kbd>Ctrl + Shift + X</kbd>
<kbd>Ctrl + Shift + Q</kbd> still opens an Ubuntu terminal at root. I suspect VS Code registers the hotkey but Ubuntu doesn't let it open a terminal. Example: <kbd>Ctrl + Shift + L</kbd> still selects a whole line. <kbd>Ctrl + ~</kbd> still opens.
Yet I also changed nothing about this deliberately: it worked 2 weeks ago. I could reinstall my entire OS and everything from scratch, but I don't want to do that.
My is terminal.external.linuxExec
setting is set to x-terminal-emulator
. The issue also reproduces if I change it to gnome-terminal
. <kbd>ctrl+shift+c</kbd> works when bound to a different command like cursorDown
. I'm on Ubuntu 22.04.2 LTS.
I use this hotkey every day, so the fact that it doesn't work now is costly for my productivity. To not fix it means that every time I want a new terminal in my current project, I have to: open a new terminal at root and then type /code/subfolder/projectName
.
答案1
得分: 4
这是一个错误。请查看Open New External Terminal Not Work (Ubuntu Linux) #179958。由于命令本身不起作用,因此绑定到它的任何键盘快捷键都不起作用。问题仍然处于分类状态,但考虑到你和我都能重现这个问题,我对它是一个错误很有信心。一旦修复完成,我将更新这个帖子。你可以给问题票上点赞表示支持。
这个错误似乎只针对Ubuntu / Linux。在我的Windows 11机器上,以及VS Code的一个维护者的macOS机器上,我都无法重现这个问题。
而且,大多数(还是全部?)分享版本信息的人都是通过Snap安装的VS Code。显然,如果你将其安装为deb包,这个问题就不存在,所以如果你不介意的话,可以采用这种方法解决。
供你参考/学习,我通过搜索“github vscode issues open new external terminal not working linux OR ubuntu
”找到了这个问题。
调试键盘快捷键问题的好方法是,正如我在评论中所示:尝试执行与键盘快捷键绑定的命令本身。然后,你可以查看问题是否与调用命令本身有关。还可以尝试将键盘快捷键绑定到一个更简单的命令,例如cursorDown
,以查看是否有任何干扰VS Code捕捉快捷键的因素,例如系统级键盘快捷键。另请参阅官方键绑定故障排除wiki。
英文:
This is a bug. See Open New External Terminal Not Work (Ubuntu Linux)
#179958. Since the command itself is not working, by extension, no keyboard shortcut that you bind to it will work. The issue ticket is still in a triage state, but given that both you and I can reproduce this, I'm pretty confident in its bug-ness. I'll update this post once the fix is made. You can give the issue ticket a thumbs up to show support for it.
The bug seems to be specific to Ubuntu / Linux. It doesn't reproduce for me on my Windows 11 machine, and it doesn't reproduce for one of the VS Code maintainers on their macOS machine.
And most (all?) people who shared version info there had VS Code installed as a Snap. Apparently if you install it as a deb package, this is not an issue, so if you don't mind that, you can take that route as a solution.
For your reference / learning purposes, I found this by googling "github vscode issues open new external terminal not working linux OR ubuntu
".
A good way to debug keyboard shortcut issues is how I showed you in the comments: Try the command itself that the keyboard shortcut is bound to. Then you can see if the issue is with the invocation command itself. And try binding the keyboard shortcut to a simpler command, such as cursorDown
, which allows you to see if there is anything interfering with VS Code picking up the shortcut, such as a system-level keyboard shortcut. See also the official keybinding troubleshooting wiki.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论