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
Have "Run Selection/Line in Python terminal" work with "Start REPL" #22242
Originally posted by cbrnr October 16, 2023
With the new smart Shift+Enter feature, it is now very convenient to run a line (or a selection of lines) of code in the interactive interpreter. After hitting Shift+Enter (or selecting "Run Selection/Line in Python terminal"), a new terminal titled "Python" opens with the interactive interpreter, which accepts intput from this command.
However, I was wondering if I can manually start this terminal (i.e., the Python one, which is connected to the "Run Selection/Line in Python terminal" action). I found the "Python: Start REPL" action, which launches the interactive interpreter, but this terminal does not accept input from Shift+Enter.
Would it be possible to unify these two ways of starting the interactive Python interpreter and/or running code? Or maybe let users decide to which terminal they want to send their Shift+Enter commands? This would be very convenient, because right now the only way to kickstart the interpreter for sending commands is to actually send the first line of code.
changed the title [-]Unify REPL and "Run Selection/Line in Python terminal" terminals?[/-][+]Have "Run Selection/Line in Python terminal" work with "Start REPL"[/+]on Oct 17, 2023
Had discussion with Raymond Zhao (@rzhao271) Essentially shift+enter was opening Interactive Window provided by Jupyter (with conda environment in his case), not the new Python REPL because of the setting was enabled. In this case, shift+enter would always send things to Interactive Window instance provided by Jupyter.
Should this be live?
It is not working for me.
I tried with version 2024.10.0 and with pre-release 2024.11 and I still see the same behaviour that Eleanor Boyd (@eleanorjboyd) posted.
Shift + Enter opens the new Python REPL but the "Python: Start Terminal REPL" command still opens the terminal window.
I tried toggling the "Send to native REPL" option on and off, and i have Jupyter disabled. In fact, I don't even have the Jupyter extension installed.
Hi Markus (@maflAT)
correct, so when you run "Python: Start Terminal REPL", it SHOULD open the terminal window regardless of your settings enabled for native REPL.
We have renamed the previously "Python: Start REPL" into "Python: Start Terminal REPL" and plan to add "Python: Start Native REPL" for the new REPL itself.
I believe everything is as expected if I didn't miss anything, but feel free to ping me again. Terminal REPL refers to the traditional ">>>" REPL you would get in the bottom of the VS Code editor.
Shift+enter will bind send commands either ONE of the Terminal REPL or the Native REPL depending on your setting. (Please make sure to check both the user and workspace setting for this).
You should be able to trigger Terminal REPL from the command palette regardless of this setting, but currently no way to trigger Start Native REPL without enabling setting and manually shift+enter on a Python file (this will come soon!)
Jupyter should not be involved in either of these scenario, so I'm bit lost on the context there. It should say "Python REPL" on the top right hand side of the editor if the native REPL gets launched.
Markus (@maflAT) Great, yes not at the moment but this should be coming soon! - thanks for your feedback. Will let you know when we push this out on a PR, so you can give it a try.
Activity
[-]Unify REPL and "Run Selection/Line in Python terminal" terminals?[/-][+]Have "Run Selection/Line in Python terminal" work with "Start REPL"[/+]Unify Terminal REPL triggers (#23641)
Unify Terminal REPL triggers (#23641)
anthonykim1 commentedon Jun 24, 2024
Verification steps:
Start Terminal REPL5 remaining items
anthonykim1 commentedon Jun 25, 2024
Had discussion with Raymond Zhao (@rzhao271) Essentially shift+enter was opening Interactive Window provided by Jupyter (with conda environment in his case), not the new Python REPL because of the setting
was enabled. In this case, shift+enter would always send things to Interactive Window instance provided by Jupyter.
Unify Terminal REPL triggers (microsoft#23641)
maflAT commentedon Jul 10, 2024
Should this be live?
It is not working for me.
I tried with version 2024.10.0 and with pre-release 2024.11 and I still see the same behaviour that Eleanor Boyd (@eleanorjboyd) posted.
Shift + Enter opens the new Python REPL but the "Python: Start Terminal REPL" command still opens the terminal window.
I tried toggling the "Send to native REPL" option on and off, and i have Jupyter disabled. In fact, I don't even have the Jupyter extension installed.
brettcannon commentedon Jul 10, 2024
Markus (@maflAT) yes, it should be in the latest release.
brettcannon commentedon Jul 10, 2024
Anthony Kim (@anthonykim1) I reopened the issue to see if this is still an issue.
anthonykim1 commentedon Jul 10, 2024
Hi Markus (@maflAT)
correct, so when you run "Python: Start Terminal REPL", it SHOULD open the terminal window regardless of your settings enabled for native REPL.
We have renamed the previously "Python: Start REPL" into "Python: Start Terminal REPL" and plan to add "Python: Start Native REPL" for the new REPL itself.
I believe everything is as expected if I didn't miss anything, but feel free to ping me again. Terminal REPL refers to the traditional ">>>" REPL you would get in the bottom of the VS Code editor.
Shift+enter will bind send commands either ONE of the Terminal REPL or the Native REPL depending on your setting. (Please make sure to check both the user and workspace setting for this).
You should be able to trigger Terminal REPL from the command palette regardless of this setting, but currently no way to trigger Start Native REPL without enabling setting and manually shift+enter on a Python file (this will come soon!)
Jupyter should not be involved in either of these scenario, so I'm bit lost on the context there. It should say "Python REPL" on the top right hand side of the editor if the native REPL gets launched.
maflAT commentedon Jul 10, 2024
Oh, I see. I misunderstood then.
I thought there should already be a command for the new REPL.
Sorry
anthonykim1 commentedon Jul 10, 2024
Markus (@maflAT) Great, yes not at the moment but this should be coming soon! - thanks for your feedback. Will let you know when we push this out on a PR, so you can give it a try.