Skip to content

When using IPython (ipython3) and using "Run Selection In terminal" only the first line executes #460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tomitrescak opened this issue Dec 19, 2017 · 8 comments
Labels
area-terminal bug Issue identified by VS Code Team member as probable bug

Comments

@tomitrescak
Copy link

Environment data

VS Code version: 1.19
Python Extension version: 0.91
Python Version: 3.6.5
OS and version: OSX High Sierra

Actual behavior

When using IPython (ipython3) and using "Run Selection In terminal" only the first line executes

Expected behavior

Whole selection should execute like in regular python terminal.

Steps to reproduce:

  • Set: "python.pythonPath": "/Users/tomi/anaconda3/bin/ipython3",
  • Select Multiple lines of code
  • Execute "Run Selection/Line In terminal"
  • Only first line runs.
@brettcannon brettcannon added awaiting 1-verification area-terminal bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster and removed awaiting 1-verification labels Dec 19, 2017
@brettcannon
Copy link
Member

Do all the lines get sent and ipython is simply not running them or is literally only the single line being sent to the terminal?

And is ipython already fully loaded before you send the code or are you sending the code prior to starting ipython?

@tomitrescak
Copy link
Author

Hi @brettcannon thanks for the fast response.

From what I'm seeing only the first line is sent to terminal.
The terminal is already running when I'm sending the code there.

@brettcannon
Copy link
Member

So the terminal is running, but is ipython already running? We have had issues in the past of ipython not being ready for the text input and it just dropping some of it, so it's important to know if ipython is already running or not when you send the code to ipython.

@ghurley
Copy link

ghurley commented Dec 24, 2017

I'm having the same issue. ipython is definitely already running. I have noticed that if you select multiple lines that are part of a single statement, all of them will be sent to ipython. e.g.:

foo = ['one',
           'two']

But if you select multiple statements only the first will go. Also noticed that it seems to be something about ipython+vscode specifically because the normal python interpreter will take all selected lines. Even if you manually cut and paste the lines, only the first will go through. But if you paste the same clipboard into ipython running in Terminal.app, all lines go through.

I've reproduced the behavior on two versions of ipython including 5.1.0 and 6.2.1. Running Mac Sierra. VSCode 1.19.1

@brettcannon brettcannon added awaiting 1-verification and removed info-needed Issue requires more information from poster labels Jan 2, 2018
@tomitrescak
Copy link
Author

@brettcannon, yes the IPython terminal is running.

@DonJayamanne
Copy link

DonJayamanne commented Jan 4, 2018

But if you paste the same clipboard into ipython running in Terminal.app, all lines go through.

This isn't an issue with the extension. If you can replicate the same issue by copying and pasting text (manually) into the integrated terminal running ipython, then its an issue with the terminal in vscode.

Please could you file this issue against VS Code with above information.

FYI - I can confirm this at my end as well.

@draran
Copy link

draran commented Mar 9, 2018

If you can replicate the same issue by copying and pasting text (manually) into the integrated terminal running ipython, then its an issue with the terminal in vscode.

I do not replicate the same issue. All lines are being sent when I copy and paste text (manually) into the integrated terminal running ipython. Perhaps not being able to send multiple lines to ipython is related to the extension.

Running interactive data analyses is very tedious without being able to select and run multiple lines.

@nndurj
Copy link

nndurj commented Mar 10, 2018

I too have the same problem on fedora 27, xfce. Only the first line gets executed. As @ghurley mentioned, this problem occurs only in ipython. Normal python console runs all the selected lines.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-terminal bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

6 participants