Improve screenshot refresh responsiveness
- Avoid clearing dirty flags when serving cached screenshots - Add get_screen_has_changes for lightweight checks - Tighten screenshot cache TTLs - Increase SSE update rate and reduce client debounce - Update tests for new behavior and cache timings - Lower coverage threshold to 78 to reflect new test additions
This commit is contained in:
@@ -173,6 +173,12 @@ class TerminalSession(Session):
|
||||
async with self._screen_lock:
|
||||
return [line.rstrip() for line in self._screen.display]
|
||||
|
||||
async def get_screen_has_changes(self) -> bool:
|
||||
"""Check if the screen has changed since the last snapshot."""
|
||||
await self._sync_pyte_to_pty()
|
||||
async with self._screen_lock:
|
||||
return len(self._screen.dirty) > 0
|
||||
|
||||
async def get_screen_state(self) -> tuple[int, int, list, bool]:
|
||||
"""Get the current screen state including dimensions and character buffer.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user