User-defined shell keybindings are triggered by VS Code input
See original GitHub issueSeveral shells (fish
, bash
, zsh
) include vi mode keybindings. It’s common for users to rebind vi escape to something like df
, jj
, or jk
.
When interfacing with the shell, VS Code behaves as if it were a user typing keys, which may trigger vi escape if file names or other text input to the shell contains the escape sequence.
To show the problematic behavior (assuming the shell is zsh
):
Include these lines in your .zshrc
bindkey -v
bindkey -M viins 'jj' vi-cmd-mode
In VS Code, try to run a Python file named jj.py
. VS Code enters this file name into the shell, which triggers the escape sequence and causes the shell to interpret .py
following the jj
as vi normal mode commands.
If VS Code input text to the shell with bracketed paste, this would not happen.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Visual Studio Code Key Bindings
Here you will find the complete list of key bindings for Visual Studio Code and how to change them.
Read more >Snippets in Visual Studio Code
Snippets in Visual Studio Code. Code snippets are templates that make it easier to enter repeating code patterns, such as loops or conditional-statements....
Read more >Terminal Shell Integration in Visual Studio Code
Shell integration allows VS Code to attach a custom keybindings to send a special sequence to PowerShell that then gets handled in the...
Read more >Advanced Terminal Usage in Visual Studio Code
Visual Studio Code's integrated terminal has many advanced features and settings, such as Unicode and emoji support, custom keybindings, and automatic replies.
Read more >How to reset Visual Studio Code key bindings? - Stack Overflow
However, there is an option to reset user defined keybindings without mess with files. Go to the Keyboard shortcuts settings: enter image description...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you, I’m gonna post this as a new issue. ❤️
This caused a regression unfortunately so reopening https://github.com/microsoft/vscode/issues/154863
The actual fix is more involved than I thought, we will need to be able to pass in a flag for whether to wrap in bracketed paste mode into the sendSequence command, internal API, extension API. An extension could wrap what it’s sending in bracketed paste mode now but that won’t work when the shell isn’t in bracketed paste mode and the extension is not able to determine that.