On a file without cells, Shift+Enter runs the current line or the selection.
On a file with cells, it should run the current cell, or the selection. It doesn't run the selection.
When I added the shift-enter re-rerouting I only dealt with the .py files with no cells. Since those were the cells that conflicted with terminal. But the with cells case the previous logic (shift-enter = run this cell) is still winning out. Run cell should only run if there is no selection.
Hello,
I'm having a similar issue where shift + enter exclusively sends to the Python terminal instead of the notebook. I've looked around to see if it's a config issue on my part and haven't found anything about VSCode's jupyter support other than just importing the notebook and pressing shift+enter.
Maybe it's a bug?
Hey @FranciscoRZ you are able to start and run the notebook normally? Our shift-enter prompt should come up if you have a valid jupyter install and ask you one time if you want to send shift-enter to our window instead of the terminal.
If you want to force this, there is a setting:
Python>Data Science: Send Selection To Interactive Window.
That way even without the popup you can get the same effect.
I never got the shift enter prompt...
I’m running VS Code from inside a Conda environment with Jupyter pip
installed, kernel specs installed so I’m pretty sure it should be a valid
install.
It’s frustrating because I feel like I almost got the perfect Python
editor, but not quite ðŸ˜
I’ll reinstall tomorrow and let you know if that’s fixes it.
Thanks for answering!
On Fri 15 Feb 2019 at 18:05, Ian Huff notifications@github.com wrote:
Hey @FranciscoRZ https://github.com/FranciscoRZ you are able to start
and run the notebook normally? Our shift-enter prompt should come up if you
have a valid jupyter install and ask you one time if you want to send
shift-enter to our window instead of the terminal.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/vscode-python/issues/4413#issuecomment-464124905,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Aipao9-RWb_t1cw-hbCTqASvkDk5Gx0Fks5vNujpgaJpZM4a8j-D
.
I’ll make sure to try it out and let you know when I get back to the office
:)
Thanks again!
On Fri 15 Feb 2019 at 18:07, Ian Huff notifications@github.com wrote:
If you want to force this, there is a setting:
Python>Data Science: Send Selection To Interactive Window.
That way even without the popup you can get the same effect.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/vscode-python/issues/4413#issuecomment-464125552,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Aipao7BZzQsB-P6htZHTgNCOTmOxbmr2ks5vNulmgaJpZM4a8j-D
.
No problem, if there are still any issues with it just give me a ping back here and I'll look into it.
Also, please add more logging for webview startup.
@IanMatthewHuff, left an answer on StackOverflow. Thanks again for taking an interest! (And sorry for the delay in answering, I forgot it was Friday last week and I wasn't coming to the office on Saturday :laughing: )
@IanMatthewHuff, I really don't understand what's happening. I just downloaded the insiders build and still don't have the option (in Command Palette Open Settings (UI)) you spoke of, nor the pop-up.
Exact steps:
cd {projectFolder}/.ipynb_checkpointsconda activate {myEnv}code-insiders .{fileName}.ipynb, import Jupyter Notebook>python: Show Python Interactive Windowprint('Hello, World') then select code and press shift+enterExpected: sends to Python Interactive window
Actual: creates new Python terminal, deactivates conda env, reactivates same conda env, sends print('Hello, World') to created terminal
@FranciscoRZ My apologies. I led you wrong here. Very sorry about that.
This code has been added (and the setting exists) but it's not yet in the public shipping version of our extension. When you mentioned insiders builds I thought that you meant the preview / dev build of our extension. But you would not yet see this fix in VSCode or VSCode - Insiders as those would both still be using our most recent public extension.
For this fix you'd need to either wait for the February release (which should be coming along pretty soon now) or you can take a peek at our current development build here:
https://github.com/Microsoft/vscode-python/blob/master/CONTRIBUTING.md#development-build
Sorry about your time looking into that.
Thanks for the helpful answer!
I'll wait for the release to make the installation is stable.
Just out of curiosity, what's the difference between the VS Code Insiders and the development build?
I thought that's exactly what Insiders was :sweat_smile:
@FranciscoRZ Yeah, so it is a bit confusing regarding that. Basically extensions (even the Microsoft provided ones) are all separate from VSCode core. VSCode - Insiders represents a development build of VSCode core only, all the extensions that you have installed would just be the normal public version of each extension. So if you have VSCode and VSCode - Insiders installed the extensions for both will all just be the same public versions. You have to update extensions specifically if you want pre-release versions of them (and not all extensions even provide pre-release versions).
Oh right, forgot about the nuance.
Anyways, thanks for taking the time! I'm a big fan of what you guys are doing. Coming from a C# dev background to Python, I really missed the feel of coding with VS and VS Code Python really does a great job of bringing it all together, so big ups to all you guys :smiley:
How do I get rid of this? I want shift+enter to run selection on a terminal and the only way I can do this now is by pressing ctrl+shift+p and selecting that instruction. currently its trying to connect to a jupyter notebook and it fails everytime. very frustrating...
Executing code failed : Error: Failed to connect to Jupyter notebook.
http://localhost:8888/
TypeError: request to http://localhost:8888/api/contents/?1551289757156 failed, reason: connect ECONNREFUSED 127.0.0.1:8888
@nosisyphus there's a setting that determines what shift+enter does. You can use that to force it to send to the terminal.

Although it's bad that your jupyter notebook isn't running. Does it crash?
@nosisyphus Is this a file with interactive cells defined (#%%) that you are working with?
@rchiodo no, doesnt crash, just tries to connect everytime I hit shift+Enter, then I get that message. I was able to go back to terminal, though, thanks to you!
@IanMatthewHuff no, regular .py with 1 line, as I was trying to test the new feature.
Sorry I should have been more specific. ECONNREFUSED can happen if the jupyter server crashes. Or if you have a remote server URI specified (another setting we have).
So you'd have to check if jupyter was running still or not.
Most helpful comment
Oh right, forgot about the nuance.
Anyways, thanks for taking the time! I'm a big fan of what you guys are doing. Coming from a C# dev background to Python, I really missed the feel of coding with VS and VS Code Python really does a great job of bringing it all together, so big ups to all you guys :smiley: