Skip to content

Commit

Permalink
Chunk driver writes on Windows per-line
Browse files Browse the repository at this point in the history
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 Textualize#2548; if this does the job we'll take this further.
  • Loading branch information
davep committed Nov 7, 2023
1 parent d958f5b commit 357268e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/textual/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 357268e

Please sign in to comment.