◐ Shell
clean mode source ↗

gh-130472: Integrate fancycompleter with the new repl, to get colored tab completions by antocuni · Pull Request #130473 · python/cpython

@bedevere-app Bot mentioned this pull request

Feb 22, 2025

hugovk

tomasr8

AA-Turner

@antocuni antocuni marked this pull request as ready for review

September 19, 2025 14:15

StanFromIreland

StanFromIreland

eendebakpt

hugovk

eendebakpt

eendebakpt

eendebakpt

eendebakpt

eendebakpt

eendebakpt

eendebakpt

eendebakpt

eendebakpt

eendebakpt

eendebakpt

@antocuni @pablogsal

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
…y this fixes the failures on Android CI
…d color. This is both more robust and more correct
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
…vance, let's add a comment to explain why
Keep pyrepl completion logic working on the uncolored completion text.
The reader now strips ANSI escapes before comparing the typed stem,
inserting a sole completion, computing the shared prefix, and filtering
an open completion menu. This fixes colored completions that would stop
refining correctly once more characters were typed.

Restore readline's callable postfix behavior for attribute completions by
routing single attribute matches through rlcompleter's callable postfix
logic while keeping the full expr.attr stem for menu refinement. Global
completion also treats soft keywords as keywords instead of trying to
evaluate them.

Avoid side effects while probing attribute values for coloring by not
forcing property access and by preserving lazy module imports. Also make
the fake color-sorting escape prefix round-trip cleanly once the match
index grows past three digits.

Only honor PYTHON_BASIC_COMPLETER when the environment is enabled, so
pyrepl setup now respects -E / sys.flags.ignore_environment. Add
regression tests for the reader behavior, callable attribute completion,
property and lazy-import safety, large color-sort prefixes, and the -E
setup path.

pablogsal

StanFromIreland

ljfp pushed a commit to ljfp/cpython that referenced this pull request

Apr 25, 2026
…olored tab completions (python#130473)

Co-authored-by: Pablo Galindo <pablogsal@gmail.com>