Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Key history lost when debugging program crash #156

Closed
ghost opened this Issue Oct 1, 2010 · 1 comment

Comments

Projects
None yet
1 participant
@ghost

ghost commented Oct 1, 2010

The normal behavior: If I write 'a' in the ipython shell with pdb enabled, I enter ipdb-mode. Here I can identify the variable 'testme' through "testme = [1,2,3]". I now type 'q' to return to the ipython shell. If I now type 't' and the up arrow (or just the up arrow) I get 'testme = [1,2,3]" at the prompt. This is expected.

However, if I enter ipdb through a program error this behaviour is lost. If I define a file 'test.py' which contains only the line '1/0' and run it through "run(testme.py)" in ipython, I end up in ipdb-mode. If I now define 'testme = [1,2,3]' followed by 'q' to return to ipython shell, the testme input is not save to history. I cannot reach it by the up arrow.

It seems reasonable that history should be saved regardless of if have entered debugging through making an error in the ipython shell or if I enter it while debugging a program that failed.

Owner

takluyver commented Jun 21, 2011

This is intentional - we want the readline history to just contain IPython commands, not debugger commands. In fact, we modify the default behaviour to achieve this. The same happens if you run an interactive program with !cmd.

@takluyver takluyver closed this Jun 21, 2011

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