Currently the %pdb magic support doesn't work, but this is part of a bigger problem that will require design thought. I'm copying here the discussion so far, so we can track it further.
%pdb is broken. Try this:
%pdb
%run file_with_error.py
nbshell hangs hard.
TZANKO: It works, but you must enter the input in a terminal, not the GUI. This is part of a bigger problem. Nbshell does not support any way of entering input to an interactive command. In order to fix this we must change the notebook format a little, but the bigger problem is that the user does not have a clue what to enter because of the way sys.stdout and sys.stderr are captured.
Consider this example:
>>> interactive_function()
stdout: Please answer yes or no:
stdin: yes
In nbshell the stdout string will be shown after the function has returned, so the user has no idea what to enter. Is this feature important? Implementing it won't be easy and will include rethinking parts of nbshell's behaviour.