VSCodeVim / Vim

:star: Vim for Visual Studio Code
http://aka.ms/vscodevim
MIT License
14.02k stars 1.32k forks source link

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

Open rdpolarity opened 2 years ago

rdpolarity commented 2 years ago

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"]
        }
    ],
  3. Attempting gc in normal mode will open COMMIT_EDITMSG to enter a commit message however vim will not register any input
  4. Then using the mouse (🤮) close the commit file (since no input is working)
  5. 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
  6. 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):

mberz commented 1 year ago

I'm experiencing the same problem. Is there any progress on this or a possible workaround?

tjander3 commented 1 year ago

I have the same problem anyone have a solution for this?

rdpolarity commented 1 year ago

Unfortunately, I never did find a work around or any fix. I haven't tested recently but I'm sad to hear it's still happening.

JannesMeyer commented 10 months ago

I also experience the same problem.

The only workaround I found is to disable commit message editors:

"git.useEditorAsCommitInput": false
ManuGraiph commented 10 months ago

I also experience the same problem.

The only workaround I found is to disable commit message editors:

"git.useEditorAsCommitInput": false

This is actually the perfect workaround, cause when you add this, vs code pops up a textfield for you to input the commit message.