Q:

Stuck in Ipython debugger loop

Everytime I press 'q', I get redirected to another ipdb session. I could just close the terminal window, but is there a better to kill the loop?

A:

The main way I use to exit the loop is Ctrl + Z. 
Otherwise, it is also possible to execute:
ipdb> import os; os._exit(1)

Here's a source to corroborate: How to quit ipdb while in post-mortem debugging?

