Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deadlock happens if wrap invokes wrap #63

Closed
tshino opened this issue Feb 24, 2022 · 1 comment · Fixed by #64
Closed

Deadlock happens if wrap invokes wrap #63

tshino opened this issue Feb 24, 2022 · 1 comment · Fixed by #64
Labels
bug Something isn't working

Comments

@tshino
Copy link
Owner

tshino commented Feb 24, 2022

This keybinding triggers a deadlock, and vscode would become unresponsive for most of the keyboard shortcuts.

{
    "key": "ctrl+a",
    "command": "kb-macro.wrap",
    "args": {
        "command": "kb-macro.wrap",
        "args": {
            "command": "editor.action.addCommentLine"
        }
    },
    "when": "kb-macro.recording"
}

This example doesn't make any sense but even it shouldn't break vscode.

@tshino
Copy link
Owner Author

tshino commented Feb 27, 2022

Preventing wrap from invoking wrap itself directly was an easy fix.

New problem

But I noticed another possibility of deadlock. That is an indirect recursive invocation of wrap.
wrap-deadlock

Possible solution

Calling wrap from any way other than keystrokes is always wrong. The wrap command is intended to be invoked only from user keystrokes directly.
Making wrap command not return Promise could be a solution.

@tshino tshino added the bug Something isn't working label Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant