vscode terminal jump word shortcuts
14 次查看(过去 30 天)
显示 更早的评论
I know this is not a 100% matlab specific question, but since it is related to the matlab official extension for vscode, I think it might be ok to ask about it here.
I am currently running matlab without GUI extlusively through vscode, since there is a bug in matlab 2025a on linux which prevents me from using dead keys on neither the workspace nor any of the built in editors.
It has worked great so far for my use case, but on vscode terminal (which is equivalent to matlab's workspace), I cannot find any way to enable ctrl+arrowleft to jump to the beginning of current word or ctrl+arrowright to jump to the end of current word. Does anyone know how to enable this functionality?
Thanks
0 个评论
回答(2 个)
Ruchika Parag
2025-7-7
Hi @Sebastián Gómez Jorge, you're right that this isn't strictly a MATLAB-specific question, but it's definitely relevant if you're using the MATLAB extension for Visual Studio Code in a no-GUI setup. The issue you're seeing—where Ctrl + ← and Ctrl + → don’t move by word in the integrated terminal—is typically related to how the terminal emulator in VS Code handles keyboard input, especially on Linux.
To isolate the cause, try launching MATLAB using matlab -nodesktop -nosplash in a standard terminal (like GNOME Terminal or xterm) outside of VS Code. If the shortcuts don’t work there either, the issue likely lies with your shell configuration rather than VS Code.
If you're using bash, check or create a ~/.inputrc file and add the following:
"\e[1;5C": forward-word
"\e[1;5D": backward-word
Then run bind -f ~/.inputrc to reload the configuration.
VS Code itself might also be intercepting those key combinations. Check your keyboard shortcuts in VS Code (Ctrl+K Ctrl+S) and search for Ctrl + Arrow. If anything is bound to those keys globally or in the terminal context, try removing or reassigning them.
If the issue turns out to be with the integrated terminal alone and everything works fine in a standalone terminal, you can configure VS Code to launch an external terminal for MATLAB interactions. This can be done by editing your settings.json with a line like:
"terminal.external.linuxExec": "gnome-terminal"
This is ultimately a combination of shell behavior and terminal emulation, rather than MATLAB itself. That said, it’s reasonable to bring it up here since it directly impacts how you interact with MATLAB in your setup. Hope this helps!
sudobash
2025-7-7
Hey Sebastian,
I too face the same issue. Looks like this has been raised on the GitHub repo as an issue: https://github.com/mathworks/MATLAB-extension-for-vscode/issues/249
Let's track this issue until it gets fixed.
I tried setting up custom key bindings VS Code, but was not successful.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!