question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

User-defined shell keybindings are triggered by VS Code input

See original GitHub issue

Several 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:open
  • Created a year ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
CharlonTankcommented, Jun 28, 2022

Not sure if this is related, but I use Spectacle to move and resize my windows. It used to work perfectly, but now, since today’s update, I cannot use my shortcut to resize my VSCode instance. The shortcuts I used were control+option+command+(left/right/down/up) to move and resize, and option+command+f to toggle fullscreen(not fullscreen but resized as fullscreen). These shortcuts do nothing in VSCode and are not triggered anymore through Spectacle

Thank you, I’m gonna post this as a new issue. ❤️

0reactions
Tyriarcommented, Jul 12, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found