Save ipython debugging session history (>= 0.11) #1298

Open
rc opened this Issue Jan 20, 2012 · 1 comment

Comments

Projects
None yet
5 participants

rc commented Jan 20, 2012

When using code below as a pdb replacement (calling debug() instead of pdb.set_trace()), the commands entered during the debugging session are not saved into history. The "< 0.11" branch works ok.

old_excepthook = sys.excepthook

if IPython.__version__ >= '0.11':
    from IPython.core.debugger import Pdb

    try:
        ip = get_ipython()

    except NameError:
        from IPython.frontend.terminal.embed \
             import InteractiveShellEmbed
        ip = InteractiveShellEmbed()

    colors = ip.colors

else:
    from IPython.Debugger import Pdb
    from IPython.Shell import IPShell
    from IPython import ipapi

    ip = ipapi.get()
    if ip is None:
        IPShell(argv=[''])
        ip = ipapi.get()

    colors = ip.options.colors

def debug(frame=None):
    sys.excepthook = old_excepthook

    if frame is None:
        frame = sys._getframe().f_back

    Pdb(colors).set_trace(frame)
Owner

fperez commented Jan 20, 2012

@takluyver, given you're our history czar, do you think this should be handled as a separate table in the sqlite storage? How do you foresee in general handling the history of interactive sub-commands?

takluyver was assigned Jan 24, 2012

@minrk minrk modified the milestone: 4.0, 3.0 Nov 14, 2014

minrk removed the prio-medium label Jan 14, 2015

@Carreau Carreau modified the milestone: 5.0, 4.0 Jun 10, 2015

@Carreau Carreau modified the milestone: wishlist, 5.0 Apr 30, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment