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

Make python.execInREPL keep focus on editor #23843

Closed
abielr opened this issue Jul 20, 2024 · 7 comments
Closed

Make python.execInREPL keep focus on editor #23843

abielr opened this issue Jul 20, 2024 · 7 comments
Assignees
Labels
area-repl feature-request Request for new features or functionality needs community feedback Awaiting community feedback
Milestone

Comments

@abielr
Copy link

abielr commented Jul 20, 2024

When I am in a Python editor and run python.execInREPL it will send selected code to the Python REPL and then switch the window focus. I would like the option to keep the focus on the editor window, similar to the behavior of Jupyter's Run Selection/Line in Interactive Window.

@abielr abielr added the feature-request Request for new features or functionality label Jul 20, 2024
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jul 20, 2024
@karthiknadig karthiknadig added needs community feedback Awaiting community feedback and removed triage-needed Needs assignment to the proper sub-team labels Jul 22, 2024
Copy link

Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.

@stevenae
Copy link

stevenae commented Aug 7, 2024

This was added as a feature years ago[1]. Seems like a regression and therefore a bug:

1 - #60 / #651

@hutch3232
Copy link

I think the difference is that this issue is for the new native REPL and the linked issue/PR is for the terminal based REPL. But I think having these as a reference is useful for extra context.

@hutch3232
Copy link

It looks like there is quite a bit of interest in this. Has now exceeded the required 7 upvotes. Hope this feature gets taken up!

@ssfrr
Copy link

ssfrr commented Oct 1, 2024

FWIW this SO post has a workaround. I've tweaked the "when" clause so that the keybinding is a little more targeted. Add this to your keybindings:

    {
        "key": "shift+enter",
        "command": "runCommands",
        "when": "editorTextFocus && activeEditor != 'workbench.editor.notebook' && editorLangId == 'python'",
        "args": {
            "commands": [
                "python.execInREPL",
                "workbench.action.focusFirstEditorGroup"
            ]
        }
    }

@amunger
Copy link

amunger commented Oct 25, 2024

@anthonykim1 - I feel like the default should be to keep the focus in the editor, trying to just shift+enter down a file requires you to move focus back after every execution, and really makes the smart execute feature less effective.

executeToREPL.mp4

@anthonykim1
Copy link

thanks all for great feedback. Let me bring this up to the team and try to make it happen soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-repl feature-request Request for new features or functionality needs community feedback Awaiting community feedback
Projects
None yet
Development

No branches or pull requests

7 participants