-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Type: Bug
Behavior
Context
Upon starting a native python REPL, the default kernel "Python REPL" is active. With the setting "python.REPL.sendToNativeREPL": true
, Shift+Enter sends code from the editor to the REPL. If the user is happy working with the default kernel, everything is fine an no issues occur. If the user wants to use a different kernel, this can be achieved by clicking on the kernel button in the top right corner of the native REPL pane. The kernel selection works as expected, and the selected kernel remains active without issues as long as code is entered and executed manually.
Where the bug manifests
The bug is that when a non-default kernel is selected and code is sent to the REPL from the editor pane by Shift+Enter, this action triggers a change of the kernel back to "Python REPL", and the code sent is interpreted by this default kernel. This makes the setting "Send to active REPL" unusable if the user works with a virtual environment.
Expected behavior
The kernel selection should not be affected by sending code to the REPL.
Environment
Python 3.12.5 on Windows 11 Pro 23H2, virtual environment managed by poetry, python extension v2024.12.3.
User settings
I have checked that any combination of the settings "interactiveWindow.executeWithShiftEnter"
, "python.terminal.activateEnvInCurrentTerminal"
and "python.terminal.activateEnvironment"
do not affect the behavior described above.
How to reproduce:
- Set
"python.REPL.sendToNativeREPL": true
. - Open the native REPL by sending code from the editor with Shift+Enter.
- Change the kernel of the native REPL to something else than "Python REPL".
- Send some code from the editor to the native REPL again (Shift+Enter).
- The kernel of the REPL has been unexpectedly changed back to default.
And since this is my first time interacting with this community I take this opportunity to thank you all for providing this awesome extension.