I have defined the following (embedded) shell in Python:
from IPython.config.loader import Config cfg = Config() prompt_config = cfg.PromptManager prompt_con
Defining the following in my ipython shell seems to do what you want:
def custom_exc(shell, etype, evalue, tb, tb_offset=None): shell.showtraceback((etype, evalue, tb), tb_offset=tb_offset) ipshell() get_ipython().set_custom_exc((Exception,), custom_exc)