I've started using realgud:pdb for python debugging in emacs: https://github.com/realgud/realgud

When you begin a realgud session, it opens a command window and a source window.

Keys like 'n' and 'b' typed inside the source window execute pdb commands, like 'next' or 'breakpoint.'

I would like to make modifications to the source code while I debug, but this is impossible if my keystrokes in the source window are captured by the debugging application.

Am I missing something? What's the right, effective workflow for making changes to source using realgud based on information I learn in the debugging process?

1 Answer 1


See realgud-srcbuf-lock variable:

Set source buffers read-only when the debugger is active. A setting of nil allows editing, but Short-Key-mode use may inhibit this.

You can also use C-x C-q in realgud-short-key-mode to turn read-only mode off.

  • Thank you. I notice this /only/ turns it off. Ideally, I'd expect to toggle back and forth. When I press C-x C-q a second time, read-only-mode is back on, but I don't regain my ability to use pdg commands like I did before C-x C-q. Nov 26, 2019 at 2:40
  • Hmm, I guess it's back if I go back into the command buffer then return to the source window. But it does not toggle back simply by staying in the source window. Nov 26, 2019 at 2:42
  • Does invoking M-x realgud-short-key-mode turn it on?
    – muffinmad
    Nov 26, 2019 at 8:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.