diff options
author | AlexSm <alex@ydb.tech> | 2023-12-27 23:31:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-27 23:31:58 +0100 |
commit | d67bfb4b4b7549081543e87a31bc6cb5c46ac973 (patch) | |
tree | 8674f2f1570877cb653e7ddcff37ba00288de15a /contrib/python/prompt-toolkit/py3/prompt_toolkit/patch_stdout.py | |
parent | 1f6bef05ed441c3aa2d565ac792b26cded704ac7 (diff) | |
download | ydb-d67bfb4b4b7549081543e87a31bc6cb5c46ac973.tar.gz |
Import libs 4 (#758)
Diffstat (limited to 'contrib/python/prompt-toolkit/py3/prompt_toolkit/patch_stdout.py')
-rw-r--r-- | contrib/python/prompt-toolkit/py3/prompt_toolkit/patch_stdout.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/contrib/python/prompt-toolkit/py3/prompt_toolkit/patch_stdout.py b/contrib/python/prompt-toolkit/py3/prompt_toolkit/patch_stdout.py index 81a7ccbb44..528bec7ffe 100644 --- a/contrib/python/prompt-toolkit/py3/prompt_toolkit/patch_stdout.py +++ b/contrib/python/prompt-toolkit/py3/prompt_toolkit/patch_stdout.py @@ -43,7 +43,7 @@ def patch_stdout(raw: bool = False) -> Generator[None, None, None]: Writing to this proxy will make sure that the text appears above the prompt, and that it doesn't destroy the output from the renderer. If no - application is curring, the behaviour should be identical to writing to + application is curring, the behavior should be identical to writing to `sys.stdout` directly. Warning: If a new event loop is installed using `asyncio.set_event_loop()`, @@ -203,6 +203,13 @@ class StdoutProxy: """ def write_and_flush() -> None: + # Ensure that autowrap is enabled before calling `write`. + # XXX: On Windows, the `Windows10_Output` enables/disables VT + # terminal processing for every flush. It turns out that this + # causes autowrap to be reset (disabled) after each flush. So, + # we have to enable it again before writing text. + self._output.enable_autowrap() + if self.raw: self._output.write_raw(text) else: |