Ensure we read buffer correctly in XTermParser

This commit is contained in:
Darren Burns
2022-06-14 11:00:20 +01:00
parent 13925b9bde
commit 1b8781f145
2 changed files with 31 additions and 7 deletions

View File

@@ -15,6 +15,15 @@ from textual.events import (
from textual.messages import TerminalSupportsSynchronizedOutput
def chunks(data, size):
chunk_start = 0
chunk_end = size
while chunk_end <= len(data):
yield data[chunk_start:chunk_end]
chunk_start = chunk_end
chunk_end += size
@pytest.fixture
def parser():
return XTermParser(sender=mock.sentinel, more_data=lambda: False)