VSCodeVim / VSCodeVim/Vim

Normal mode keybinds with vscode commands that await input block / freeze vim

Open
#7,951 5 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Description

Describe the bug
When configuring custom vim keybindings (in normal mode) that trigger a command that opens any kind of blocking task like git.commit or git.checkout, Vim will freeze/become unusable until said task is complete, to which it will run all commands you attempted to press while the command was running.

To Reproduce
Steps to reproduce the behavior:

  1. Go to settings.json
  2. Add the following:
    "vim.normalModeKeyBindings": [
        {
            "before": ["g", "c"],
            "commands": [
                {
                    "command": "git.commitAll"
                },
            ],
        },
        { 
            "before": ["g", "b"],
            "commands": ["git.checkout"]
        }
    ],
  1. Attempting gc in normal mode will open COMMIT_EDITMSG to enter a commit message however vim will not register any input
  2. Then using the mouse (🤮) close the commit file (since no input is working)
  3. After clicking close on Commit operation was canceled due to empty commit message it will bulk run every key and operation you pressed while commit command was running
  4. Running gb will do the same after quickly canceling the dialog, to which vim becomes intently unusable, not taking in any input until the extension is restarted

Expected behavior
Vim should be usable immediately after or during any VSCode blocking command

Screenshots
May be good to see that the "g" part of the command remains stuck while the command is running
image

If remapping-related, please attach log output: https://github.com/VSCodeVim/Vim#debugging-remappings.
^ In regard to the above, I personally don't see anything and the keybinds do register and run correctly. If I'm wrong I'll update this with whatever shows.

Environment (please complete the following information):

  • Extension (VsCodeVim) version: v1.23.2
  • VSCode version: 1.71.0
  • OS: Windows 10

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the freeze with the normalModeKeyBindings in settings.json, using git.commitAll and git.checkout. Compare key handling while each VS Code command awaits input, then verify that Vim remains usable during and after the command without replaying buffered keys.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.