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

vim keybindings can break input #620

Open
znd4 opened this issue Jun 26, 2024 · 3 comments
Open

vim keybindings can break input #620

znd4 opened this issue Jun 26, 2024 · 3 comments

Comments

@znd4
Copy link

znd4 commented Jun 26, 2024

idk if there's even a fix that could be implemented in this project for this, but some vim keybindings from vscode-neovim (e.g. G) make using stdin problematic.

I think one option would be to set SUDO_ASKPASS to a command that opens a prompt, but I think it'd be hard to secure that

@sourishkrout
Copy link
Member

Hi @znd4! Thanks for filing this issue.

Could you please share an example or some steps to reproduce the issue? That'd be really helpful to speed up the investigation and possible fixes.

@znd4
Copy link
Author

znd4 commented Jun 27, 2024

no problem, thanks for the quick response!

I think (but am not sure) that it'd be sufficient to install vscode-neovim and runme on an otherwise bare / fresh vscode install, then create a markdown file with the following code cell followed by some other cell:

read $input

Run the cell and try entering "good morning" in the input and hit enter. the cell should complete.

Now run the cell again, but this time, try typing "Good morning" and hitting enter. The expected behavior is that the cell would complete and you'd see Good morning. instead, I jump to the last cell, the code cell doesn't complete, and all I see in the cell's input is G.

there are three "shift+g" keybindings from the vscode-neovim extension, but based on testing, it looks like the culprit is list.focusLast:

            {
                "key": "shift+g",
                "command": "list.focusLast",
                "when": "listFocus && !inputFocus"
            },

I'm guessing that a fix might involve making sure that inputFocus is true when the cursor is in an interactive runme cell output, although idk what exactly inputFocus is or where it comes from

@sourishkrout
Copy link
Member

Thanks for the thorough description. We'll work reproducing the issue and see what's possible @znd4. Will keep you posted here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants