Repository navigation
Use colors in tab-completion in PyREPL #130472
Description
Activity
- addedtopic-replRelated to the interactive shellRelated to the interactive shelltype-featureA feature request or enhancementA feature request or enhancement
on Feb 22, 2025 - addedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
on Feb 22, 2025 I actually have a question about the overall color-related features - how many colors can we use at this point, and how should we use them? If I remember correctly, it took a while to land on this magenda color for some stuff, and we are planning to add much more colors for completion? How much we need to think about for color-blindness or different terminal backgrounds to use new colors? I always have this question because pdb could really use some colors, but it doesn't seem like we have a consensus about how we can use them.
@gaogaotiantian the plan is to add theming support in PYTHONSTARTUP. I'll be working on this in March.
Got it, thanks!
This introduced some regressions:
Screencast.From.2026-04-06.10-41-01.mp4
(yes, they are blinking)
I found the root cause for some issues, though contrast issues remain: https://github.com/python/cpython/pull/130473/changes#r3038878981
Looking into it
I think #148161 should do the trick
If it's ok, I'll reopen this for #148188 since it's related (I can also open a separate issue if you prefer though)

The current tab-completer is somewhat basic. There's a pyrepl-based library called fancycompleter that allows for context-aware colorful tab completions. Much more useful and looks better.
Linked PRs