title: In the Python debugger pdb, how do you exit interactive mode without terminating the debugging session
body: <p>Using python 3.5.1</p>
  
  <p>When I run a script using the python debugger module:</p>
  
  <pre><code>  [home]# python -m pdb myscript.py
  </code></pre>
  
  <p>This starts a debug session:</p>
  
  <pre><code>  &gt; /somepath/to/myscript.py(1)&lt;module&gt;()
    -&gt; import os
    (Pdb) 
  </code></pre>
  
  <p>If I want to enter an interactive terminal from within the debug session I can issue the <code>interact</code> command:</p>
  
  <pre><code>(Pdb) interact
  *interactive*
  &gt;&gt;&gt;
  </code></pre>
  
  <p>Now I can interact with th code as if I was in a running python interactive mode, with access to any functions or variable in scope of the script running in the debugger at the time I entered <code>interact</code> mode.</p>
  
  <p>When I issue the command to exit the interactive mode (to continue debugging) it kills the entire debug session:</p>
  
  <pre><code>&gt;&gt;&gt; exit()
  The program exited via sys.exit(). Exit status: None
  ....long nasty stack trace here....
  
  [home]#
  </code></pre>
  
  <p>I've also tried <code>quit()</code> and it also terminates the debugger. </p>
  
  <p>How can you exit out of <code>interact</code> mode without terminating the entire debug session?   Is this even possible?</p>
  
  <p>Ideally, I'd like to return to into debug mode at the point where I left off so I could continue stepping through my code.</p>