```
2024-10-05 15:12:00.813 [error] File "c:\Users\User\.vscode\extensions\ms-python.python-2024.16.0-win32-x64\python_files\python_server.py", line 162
while line := STDIN.readline().strip():
^
SyntaxError: invalid syntax
2024-10-05 15:12:00.816 [error] Python server exited with code 1
2024-10-05 15:14:46.427 [error] Error getting response from REPL server: [k [Error]: Connection is closed.
at pe (c:\Users\User\.vscode\extensions\ms-python.python-2024.16.0-win32-x64\out\client\extension.js:2:2053423)
at Object.sendRequest (c:\Users\User\.vscode\extensions\ms-python.python-2024.16.0-win32-x64\out\client\extension.js:2:2055781)
at g.executeCode (c:\Users\User\.vscode\extensions\ms-python.python-2024.16.0-win32-x64\out\client\extension.js:2:799948)
at g.execute (c:\Users\User\.vscode\extensions\ms-python.python-2024.16.0-win32-x64\out\client\extension.js:2:799770)
at u.value (c:\Users\User\.vscode\extensions\ms-python.python-2024.16.0-win32-x64\out\client\extension.js:2:829806)
at i.executeHandler (c:\Users\User\.vscode\extensions\ms-python.python-2024.16.0-win32-x64\out\client\extension.js:2:805190)
at bb.$executeCells (file:///c:/Users/User/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:155:24084)
at Zb.S (file:///c:/Users/User/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:31:113896)
at Zb.Q (file:///c:/Users/User/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:31:113676)
at Zb.M (file:///c:/Users/User/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:31:112765)
at Zb.L (file:///c:/Users/User/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:31:111870)
at gh.value (file:///c:/Users/User/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:31:110667)
at T.B (file:///c:/Users/User/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:732)
at T.fire (file:///c:/Users/User/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:950)
at no.fire (file:///c:/Users/User/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:31:9399)
at gh.value (file:///c:/Users/User/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:174:13273)
at T.B (file:///c:/Users/User/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:732)
at T.fire (file:///c:/Users/User/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:950)
at no.fire (file:///c:/Users/User/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:31:9399)
at MessagePortMain.<anonymous> (file:///c:/Users/User/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:174:11562)
at MessagePortMain.emit (node:events:519:28)
at MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:2619)] {
code: 1
}
```
"Smartly" allow execute on enter for the
https://github.com/microsoft/vscode-python/pull/23235 experiment.
User should be able to execute when they press enter on text input box
of interactive window trigger from Python extension, whereas we would
"wait" and allow insertion of new line after detecting user's Python
command is not complete.
When the user finally types enter again on a blank line, we should just
proceed to execute whatever code, regardless of whether it is
complete/valid or not to replicate Python's original interactive REPL
behavior.
Basically creating Python command and registering that for keybinding of
'Enter'.
This would conditionally call interactive.execute which would then
eventually call our execute handler contributed from Python n
extension's REPL controller, or go ahead and insert,pass in Enter to the
text input box to allow user to type "complete" code.
This PR only intends to implement/add changes regarding execute on enter
logic, adding Intellisense support, and also adding things into
disposables so they can be properly disposed. Trying to also add setting
to allow toggling on/off to send Python command to Terminal or IW REPL
if the user is in experiment.
Handling of interrupt for windows should be on separate PR.
Test will be added later as separate PR.
---------
Co-authored-by: Courtney Webster <60238438+cwebster-99@users.noreply.github.com>
Co-authored-by: Karthik Nadig <kanadig@microsoft.com>
Allow users to use Interactive Window UI with Python custom REPL
controller instead of iPykernel.
Closes#23175Closes#23174
Closes https://github.com/microsoft/vscode-python/issues/23029
Majority of: #23332
Context menu under Python for running Python REPL code using IW UI
should only appear when user's ```pythonRunREPL``` experiment is
enabled.