diff --git a/rsbbs/console.py b/rsbbs/console.py index ce0fa1a..191585f 100644 --- a/rsbbs/console.py +++ b/rsbbs/console.py @@ -105,14 +105,26 @@ class Console(): input_lines.append(input_line) return ''.join(input_lines) + def write_chunk(self, chunk: str) -> None: + """Write a chunk of data to stdout. + + :param output: the chunk to write to stdout + + """ + sys.stdout.write(chunk + '\r\n') + sys.stdout.flush() + def write_output(self, output: str) -> None: """Write something to stdout. :param output: the string to write to stdout """ - sys.stdout.write(output + '\r\n') - sys.stdout.flush() + chunk_size = 256 # Adjust the chunk size as needed + + for i in range(0, len(output), chunk_size): + chunk = output[i:i + chunk_size] + self.write_chunk(chunk) def print_configuration(self) -> None: """Print the current running configuration.