Skip to content
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

Shift+Enter to run cell doesn't work frequently when first running python interactive in a new project #3347

Closed
AeneasZhu opened this issue Jun 3, 2019 · 12 comments
Assignees

Comments

@AeneasZhu
Copy link

When I press Shift+Enter or Ctrl+Enter to run a cell in python jupyter (not the python interactive window one) in a new project, it doesn't and I have to click the "run cell" on my own to run the cell

image

@greazer
Copy link
Member

greazer commented Jun 6, 2019

@AeneasZhu, can you confirm that what you're saying is that, you open a python file with cells, then in one of the cells you press shift-enter. The interactive window doesn't start? Or something else? You can only get out of this situation by running via the "Run Cell" codelens?

@AeneasZhu
Copy link
Author

@AeneasZhu, can you confirm that what you're saying is that, you open a python file with cells, then in one of the cells you press shift-enter. The interactive window doesn't start? Or something else? You can only get out of this situation by running via the "Run Cell" codelens?

Kind of. I mean, when I create a py file in a new created folder with 'cells', and press 'shift+enter' or 'ctrl + enter', the interactive window just reads the line where the cursor is, not the whole cell.

@rchiodo
Copy link
Contributor

rchiodo commented Jun 11, 2019

This happens for me too.

  • Create new folder
  • Create new py file
  • Add a cell with two lines in it
  • Shift+Enter

Only the line with the cursor is run.

@AeneasZhu
Copy link
Author

This happens for me too.

  • Create new folder
  • Create new py file
  • Add a cell with two lines in it
  • Shift+Enter

Only the line with the cursor is run.

Is it a bug?

@rchiodo
Copy link
Contributor

rchiodo commented Jun 12, 2019

Yes I believe so.

@AeneasZhu
Copy link
Author

Yes I believe so.

Can it be dealt with in the next update?

@rchiodo
Copy link
Contributor

rchiodo commented Jun 13, 2019

It likely will be. We assign labels and pipelines to bugs. This one is a P1 in the backlog meaning it should be dealt with before our next release.

@rchiodo rchiodo self-assigned this Jun 18, 2019
@radu-b
Copy link

radu-b commented Jul 11, 2019

It still happens in 2019.6.24221, pretty much all the time, not just on new files but also on existing ones. Sometimes it starts working (i.e. running the current cell) after several attempts, or after running code manually in the interactive window; sometimes it just keeps running only the current line without advancing the pointer.

The issue doesn't happen in the last 2019.5 version (or if it does, it's quite rare), so I have to stick to that version.

I'm on Ubuntu 18.04, VS Code 1.36.1.

@rchiodo
Copy link
Contributor

rchiodo commented Jul 11, 2019

@radu-b do you have the code lens at the top of each cell when this is happening?

Does it happen if you reload vscode?

@AeneasZhu
Copy link
Author

It still happens in 2019.6.24221, pretty much all the time, not just on new files but also on existing ones. Sometimes it starts working (i.e. running the current cell) after several attempts, or after running code manually in the interactive window; sometimes it just keeps running only the current line without advancing the pointer.

The issue doesn't happen in the last 2019.5 version (or if it does, it's quite rare), so I have to stick to that version.

I'm on Ubuntu 18.04, VS Code 1.36.1.

I think I have solved this problem in some way. Once you open the Interative Window, you shall click the right side(where the interative window is) once, and the shift+enter shall work. I don't know why, but I just found it

@radu-b
Copy link

radu-b commented Jul 12, 2019

@rchiodo no, I had the code lens hidden. I've tried again with it visible, and the issue doesn't happen. It only occurs with the code lens hidden. Restarting makes no difference.

I can confirm AeneasZhu's comment above, clicking the interactive input solves the problem even with the code lens hidden.

@rchiodo
Copy link
Contributor

rchiodo commented Jul 12, 2019

Ah having the code lens hidden makes sense. It looks like the code doesn't activate the right context unless code lens are active.

@rchiodo rchiodo assigned rchiodo and unassigned rchiodo Jul 12, 2019
@rchiodo rchiodo closed this as completed Aug 6, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 13, 2019
@microsoft microsoft unlocked this conversation Nov 14, 2020
@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 14, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants