You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use pyrepl+fanycompleter as the default readline for pdb #139167
Once #130473 is merged, we can think of using it also for pdb.
This would enable colored completion from the pdb prompt, like this (for context, pdb++ has been doing this for years)
This raises some minor questions such as whether the (pdb) prompt should be white or magenta.
There are a lot of things that can be done in pdb's terminal. I have no objection to make pdb fancier, but we probably should have a list. I don't think it's trivial to integrate pyrepl to pdb.
I don't think it's trivial to integrate pyrepl to pdb.
for the record, pdbpp has used pyrepl+fancycompleter by default since at least version fancycompleter==0.3, which was released in 2012.
Integration is surprisingly simple: pyrepl._setup() monkey-patches builtins.input, and then colored completion works out of the box without having to change pdb at all. This combination worked flawlessly for me on linux with all version of python from 2.7, but I assume it also worked well on mac and windows, since pdbpp it's actually quite popular.
Basically, what I'm proposing is to call pyrepl._setup() when pdb is started (either inside Pdb.__init__ or inside Pdb.interaction), and then to use fancycompleter instead of rlcompleter.
As long as it does not break any tests (or the break is reasonable and we can fix the test), or basically is somewhat backwards compatible, I'm okay with it. I believe the users are mostly fine with it, but there are other tools that depend on pdb. From the experience I had working with it, there could be unexpected consequences.
I'm totally onboard with making pdb more "modern", just on a reasonable and responsible pace.
Activity
gaogaotiantian commentedon Sep 20, 2025
There are a lot of things that can be done in pdb's terminal. I have no objection to make pdb fancier, but we probably should have a list. I don't think it's trivial to integrate pyrepl to pdb.
antocuni commentedon Sep 20, 2025
for the record, pdbpp has used pyrepl+fancycompleter by default since at least version fancycompleter==0.3, which was released in 2012.
Integration is surprisingly simple: pyrepl._setup() monkey-patches
builtins.input, and then colored completion works out of the box without having to change pdb at all. This combination worked flawlessly for me on linux with all version of python from 2.7, but I assume it also worked well on mac and windows, since pdbpp it's actually quite popular.Basically, what I'm proposing is to call
pyrepl._setup()when pdb is started (either insidePdb.__init__or insidePdb.interaction), and then to use fancycompleter instead of rlcompleter.gaogaotiantian commentedon Sep 20, 2025
As long as it does not break any tests (or the break is reasonable and we can fix the test), or basically is somewhat backwards compatible, I'm okay with it. I believe the users are mostly fine with it, but there are other tools that depend on
pdb. From the experience I had working with it, there could be unexpected consequences.I'm totally onboard with making
pdbmore "modern", just on a reasonable and responsible pace.gh-139167: Allow users to hook gen_colors function to pyrepl Reader (#…