[3.13] gh-120041: Do not use append_to_screen when completions are visible (GH-120042) (#120051)

* gh-120041: Do not use append_to_screen when completions are visible (GH-120042)
(cherry picked from commit 8fc7653766)

* gh-120041: Refactor check for visible completion menu in completing_reader (GH-120055)
(cherry picked from commit bf8e5e53d0)
---------

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-06-04 20:10:29 +02:00 committed by GitHub
parent 2acbdc23ad
commit 8d74eae4d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 52 additions and 10 deletions

View file

@ -39,7 +39,7 @@ def code_to_events(code: str):
def prepare_reader(console: Console, **kwargs):
config = ReadlineConfig(readline_completer=None)
config = ReadlineConfig(readline_completer=kwargs.pop("readline_completer", None))
reader = ReadlineAlikeReader(console=console, config=config)
reader.more_lines = partial(more_lines, namespace=None)
reader.paste_mode = True # Avoid extra indents