Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I enable pdbtrack python debugging in emacs 24.x shell?

Tags:

python

emacs

pdb

With emacs 23.x, pdbtrack integration (giving you the arrow pointing to the current line of code) works with the regular M-x shell RET. This is useful, for example, to drop into the debugger while running automated tests with a Makefile.

In emacs 24.x, this no longer works. I notice that if I run a python script with M-x python-shell-send-file then the pdbtrack integration works. But it does not work when running python via a standard emacs shell (M-x shell RET).

like image 213
reteptilian Avatar asked Apr 14 '26 05:04

reteptilian


1 Answers

I use this snippet:

(require 'python)

(defun my-shell-mode-hook ()
  (add-hook 'comint-output-filter-functions 'python-pdbtrack-comint-output-filter-function t))

(add-hook 'shell-mode-hook 'my-shell-mode-hook)

to prevent the pdbtrack stuff from trying to work on other buffers (eg gdb buffers).

like image 58
sfink Avatar answered Apr 16 '26 18:04

sfink



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!