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

History lost in interactive python #3285

Closed
Hristiyan-Andreev opened this issue Jul 9, 2019 · 5 comments
Closed

History lost in interactive python #3285

Hristiyan-Andreev opened this issue Jul 9, 2019 · 5 comments
Assignees

Comments

@Hristiyan-Andreev
Copy link

Hello, I've been actively using the Jupyter notebook feature (Interactive Python window) to prototype and test chunks of code easily.
However, I've noticed that after doing many inputs [eg. 61] from the console, the history gets lost.

Am I doing something wrong or the Interactive python workbook history is pretty limited?

What I mean by that is that I cannot scroll up to find my first inputs [before 55] or their relative outputs. When I export as Jupyter notebook from the button, I get an .ipynb file with only my last few inputs [eg. 55-61]. Of course, those inputs cannot output anything, because the variables from the previous inputs are missing.

When scrolling the Variables windows in VScode I can find all my variables from previous outputs and work with them - just as expected.

The only thing that saved me from losing all my work was the command history in the Interactive python console (using the arrow keys when entering a command, to find the previously used ones)

Screenshot from VSCode after many inputs on the console:
VScode1

Screenshot in Jupyter (from browser) after exporting the notebook. It exports only the last inputs.
VScode2

Version: 1.35.1 (system setup)
Commit: c7d83e57cd18f18026a8162d042843bda1bcf21f
Date: 2019-06-12T14:30:02.622Z
Electron: 3.1.8
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 6.1.7601

@rchiodo
Copy link
Contributor

rchiodo commented Jul 9, 2019

Does this always happen or just this once? If I enter 100 print statements in the interactive window, they're all there. The only thing that should remove statements would be for you to have clicked one of the delete buttons (although the fact that everything is gone sounds like something else is causing it)

What sort of code did you run?

@greazer
Copy link
Contributor

greazer commented Jul 11, 2019

@Hristiyan-Andreev, we're going to spend some time trying to reproduce this problem. During that time, if you can come up with some pattern or something to help us, please let us know.

@rchiodo
Copy link
Contributor

rchiodo commented Jul 11, 2019

I would hazard a guess that the escape key was hit during intellisense coming up. This causes the focus to switch to the delete all button

The intellisense escape should not cause the focus to change.

@rchiodo
Copy link
Contributor

rchiodo commented Jul 11, 2019

Might want an 'are you sure' for delete all?

@Hristiyan-Andreev
Copy link
Author

Hristiyan-Andreev commented Jul 12, 2019

Hello and thank you for the attention on that matter.
I am trying to reproduce it on my personal computer but I still can't.
This is what I remember when it occurred:

  1. I ran a few cells from a file (queries.py)
  2. I started trying out with some dataframe and SQlAlchemy functions in the Interactive window, using the output from the already ran cells.
  3. At some point I figured out which tryouts (called functions) gave me the wanted resulted and tried to scroll back to them.
  4. I couldn't scroll back past the 55-th statement in the Interactive window.
  5. All the variables and history (even from statement 1) were still there.

Update:
I tried to hit escape on intellisense suggestion and yes it focuses the delete all button. If "Enter" is pressed it will delete all cells, but will keep the input history and the variables from the deleted cells.
My guess is that probably this happened.

So probably the intellisense escape is the cause.

@rchiodo rchiodo closed this as completed Aug 6, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 14, 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

3 participants