question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unsaved Notebook data is lost on exit

See original GitHub issue

Bug: Notebook Editor, Interactive Window, Editor cells

Steps to cause the bug to occur

  1. Launch VSCode.
  2. Create new blank Notebook (Ctrl+Shift+P then enter Python: Create Blank New Jupyter Notebook)
  3. Modify the notebook (eg, enter print("Hello abyss!") in the cell and press Ctrl+Enter)
  4. Close VSCode.
  5. Re-launch VSCode.
  6. Witness your work gone into the abyss.
  7. Optional: Smash computer screen with heavy object.

Actual behavior

VSCode blissfully discards any unsaved changes.

Expected behavior

Either (a) an “Are you sure?”-type confirmation dialog is shown on exit; or (b) the file is restored, when VSCode is relaunched, which is what’s done with other file types.

Your Jupyter and/or Python environment

Please provide as much info as you readily know

  • Jupyter server running: N/A
  • Extension version: v2020.4.76186
  • VS Code version: 1.45
  • Setting python.jediEnabled: false
  • Python and/or Anaconda version: python 3.8.2 (no Anaconda)
  • OS: Ubuntu 20.04 LTS
  • Virtual environment: N/A

Developer Tools Console Output

Nah… that ain’t me

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
tbenstcommented, Jul 10, 2020

Note that this problem is especially bad if VSCode crashes or is closed accidentally (i.e. I errantly typed ctrl-w to delete a word from terminal habit but closed the tab and lost all my work. 🤦). Classic Jupyter as served in browser lets you reload the webpage and presents you with your unsaved changes. Likewise, VScode does something similiar with .py files. Please adopt the behavior from .py files:

  1. add the x or o icon on the notebook viewer tab
  2. prompt to save if closing
  3. restore unsaved on crash

Thanks so much for this excellent extension 😃

1reaction
IanMatthewHuffcommented, Aug 26, 2020

@DavidKutu and I both validated this. Validated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unsaved Notebook data is lost on exit · Issue #1746 - GitHub
Steps to cause the bug to occur. Launch VSCode. Create new blank Notebook (Ctrl+Shift+P then enter Python: Create Blank New Jupyter Notebook) ...
Read more >
How to Recover Unsaved Notepad Files on Windows 10/11
Step 1. Run EaseUS Data Recovery Wizard. Choose the drive where you lost files and start scanning. This software allows you to recover...
Read more >
5 Steps to Recover Deleted or Unsaved Notepad (TXT) Files
Select “All recovery methods” and click on Search for lost data. It's best if you allow the scan to complete. After it's done,...
Read more >
4 Tips to Recover Unsaved/Deleted Notepad (TXT) Files 2022
Solution 1: Recover Deleted Notepad Files with 4DDiG ... The temporary files can only be used to recover unsaved material; they won't help...
Read more >
How to recover an unsaved Notepad file on Windows 10 - Quora
2. At the top of the Appdata window, select Roaming, which navigates to C:\Users\Username\AppData\Roaming. This folder may contain your unsaved notepad files.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found