From 357268e93c0de81f00c370fd0d6914e7a34e1c80 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Tue, 7 Nov 2023 14:24:40 +0000 Subject: [PATCH] Chunk driver writes on Windows per-line This is experimental. I think, ideally, we'll do this by finding an optimal buffer size and writing based on that, but for the moment let's just try line-by-line as that's easy. This will be used to test against the tool I've made that lets me recreate the issue documented in #2548; if this does the job we'll take this further. --- src/textual/app.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/textual/app.py b/src/textual/app.py index f7296edb6f..67e8dce04a 100644 --- a/src/textual/app.py +++ b/src/textual/app.py @@ -2526,7 +2526,12 @@ def _display(self, screen: Screen, renderable: RenderableType | None) -> None: except Exception as error: self._handle_exception(error) else: - self._driver.write(terminal_sequence) + if WINDOWS: + write = self._driver.write + for line in terminal_sequence.split("\n"): + write(line) + else: + self._driver.write(terminal_sequence) finally: self._end_update()