gh-130472: Integrate fancycompleter with the new repl, to get colored tab completions by antocuni · Pull Request #130473 · python/cpython
Bot
mentioned this pull request
antocuni
marked this pull request as ready for review
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
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.
ljfp pushed a commit to ljfp/cpython that referenced this pull request
…olored tab completions (python#130473) Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters