| 382 | |
| 383 | |
| 384 | class LiveTailBuffer(Buffer): |
| 385 | def __init__(self): |
| 386 | super().__init__() |
| 387 | self._pause_buffer = Buffer() |
| 388 | |
| 389 | @property |
| 390 | def pause_buffer(self): |
| 391 | return self._pause_buffer |
| 392 | |
| 393 | def add_text(self, data: str) -> bool: |
| 394 | if not get_app().layout.has_focus(self): |
| 395 | self.text += data |
| 396 | self.cursor_position = len(self.text) |
| 397 | else: |
| 398 | self._pause_buffer.text += data |
| 399 | |
| 400 | |
| 401 | class InteractivePrinter(BaseLiveTailPrinter): |