On Mathematica 12.0 for Windows, I have a package foo.wl, and a testing notebook fooTests.nb. My first test loads the file:

Get[NotebookDirectory <> "foo.wl"]

I had left code in foo.wl that causes an infinite loop; realizing this I first tried Alt + . but had to quit the kernel through the menu. Immediately after this, I was unable to edit or select anything in the testing notebook. When I saved and quit fooTests.nb, then relaunched Mathematica, the problem persisted. I can't copy and paste the tests to a new notebook.

  • Can anyone reproduce?
  • What's the cause?
  • Can I get my testing notebook back?
  • 1
    $\begingroup$ According to my experience with testing notebooks, I would suggest that you avoid using them and switch to packages. See this answer for details. $\endgroup$
    – Pinti
    Commented Jul 16, 2019 at 10:58

1 Answer 1


I sympathize. Something similar happened to me (several times) which is why I wrote a backup package. I've seen a few other such packages around too. My copy at GitHub is not updated to 12.0 (task control functions changed). My updated version is bundled with commercial software, but I plan to separate it out (eventually).

As to why... If your infinite loop was printing output then if you wait several hours for the notebook to format, occasionally it will let you cut-and-paste.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.