title: Jupyter notebook stuck in pdb mode
body: <p>I'm using Jupyter (IPython) notebook, where pdb / ipdb runs fine, except for one problem: If I accidentally run the same cell that my pdb is in while in pdb mode, the output disappears, the entire notebook gets stuck and I can't run any more commands. I also tried interrupting or restarting the kernel; doesn't work. My only option is to shut down the notebook, and restart it.</p>
  
  <p>Does anyone else experience this problem / know of a solution? Very annoying for me to have to restart the notebook every time I make this mistake.</p>
  
  <p>Here are screenshots of the problem. Below I'm in pdb mode as expected:</p>
  
  <p><a href="https://i.stack.imgur.com/CDvh1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/CDvh1.png" alt="enter image description here"></a></p>
  
  <p>If I then (accidentally) run the same cell my pdb is in, the notebook gets stuck trying to run that cell, and won't run anything else (like the cell below).</p>
  
  <p><a href="https://i.stack.imgur.com/6KbJW.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6KbJW.png" alt="enter image description here"></a></p>