Skip to content

Use pyrepl+fanycompleter as the default readline for pdb #139167

Open

Description

@antocuni

Feature or enhancement

Proposal:

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)

Image

This raises some minor questions such as whether the (pdb) prompt should be white or magenta.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

Activity

  1. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Sep 19, 2025
  2. gaogaotiantian commented on Sep 20, 2025

    @gaogaotiantian
    Member

    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.

  3. antocuni commented on Sep 20, 2025

    @antocuni
    ContributorAuthor

    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.

  4. gaogaotiantian commented on Sep 20, 2025

    @gaogaotiantian
    Member

    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.

  5. added a commit that references this issue on May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions