You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make python.execInREPL keep focus on editor #23843
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.
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.
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.
Anthony Kim (@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.
Activity
github-actions commentedon Jul 22, 2024
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 commentedon Aug 7, 2024
This was added as a feature years ago[1]. Seems like a regression and therefore a bug:
1 - #60 / #651
hutch3232 commentedon Aug 7, 2024
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 commentedon Sep 5, 2024
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 commentedon 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 commentedon Oct 25, 2024
Anthony Kim (@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 commentedon Oct 28, 2024
thanks all for great feedback. Let me bring this up to the team and try to make it happen soon.
add bracketed paste mode for Python3.13 and above (microsoft#24401)
Keep focus on editor when executing to native REPL (microsoft#24420)
anthonykim1 commentedon Dec 2, 2024
Verification steps: