prompt-toolkit / python-prompt-toolkit

Library for building powerful interactive command line applications in Python
https://python-prompt-toolkit.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
9.1k stars 717 forks source link

Fix line wrapping in `patch_stdout` on Windows. #1827

Closed jonathanslenders closed 6 months ago

jonathanslenders commented 6 months ago

Enable autowrap before writing data to the output in patch_stdout. We enable/disable VT terminal processing during every flush() of the Windows Output implementation, but it turns out that this causes the autowrap flag to be reset each time. Because of this, we have to enable autowrap each time before writing.