title: pdb in JupyterLab not entering interactive mode
body: <p>My goal is to run some python scripts with <code>pdb</code> or <code>ipdb</code> in JupyterLab to capture my debugging history.</p>
  
  <p>I first inserted <code>set_trace()</code> in my python script:</p>
  
  <pre class="lang-py prettyprint-override"><code>import torch
  from IPython.core.debugger import set_trace
  
  def train_batch(model_instance, inputs_source, labels_source, inputs_target, optimizer, args):
      inputs = torch.cat((inputs_source, inputs_target), dim=0)
      total_loss, train_stats = model_instance.get_loss(inputs, labels_source)
      total_loss[args.train_loss].backward()
  
      set_trace() # insert breakpoint
  
      optimizer.step()
      return train_stats
  </code></pre>
  
  <p>I then run this script in my JupyterLab:</p>
  
  <pre class="lang-sh prettyprint-override"><code>!python ./trainer/train.py \
      --base_config ./config/sgd_vannila_0.001.yml \
      --dataset Office-Home \
      --class_num 50 \
      --src_address ./data/office-home/Art.txt \
      --tgt_address ./data/office-home/Clipart.txt \
      --name transfer.debug.rand_noise \
      --train_steps 10000 \
      --seed 2 \
      --filter_classes=0,50 \
      --eval_interval 50
  </code></pre>
  
  <p>The execution stops at the breakpoint, but does not provide an interactive box to prompt any <code>ipdb</code> instructions. The same is happening for <code>pdb</code> or jupyter notebook.</p>
  
  <p><a href="https://i.stack.imgur.com/CeXJr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CeXJr.png" alt="enter image description here"></a></p>
  
  <hr>
  
  <p>Things I have tried:</p>
  
  <ul>
  <li>restarting Chrome browser, or my laptop, does not help</li>
  <li>adding breakpoint inside the notebook code block works (please see screenshot below), but I would like to be able to debug code written in my python module file
  <a href="https://i.stack.imgur.com/i3xkO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/i3xkO.png" alt="enter image description here"></a></li>
  </ul>
  
  <hr>
  
  <p>Version information:</p>
  
  <ul>
  <li>ipdb-0.12.2</li>
  <li>Python 3.6.9</li>
  <li>JupyterLab 0.35.5</li>
  </ul>