Save ipython debugging session history (>= 0.11)
- Dominant language
- Python
- Stars
- 16.8k
- Forks
- 4.5k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 6
Description
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)
```
Contributor guide
Assessment
This issue has not been assessed yet.