feat: enhance terminal session handling with output acknowledgment and error handling

This commit is contained in:
2026-09-25 19:54:07 +05:30
parent 9541e29b76
commit 73d85fefe4
3 changed files with 21 additions and 6 deletions
+1 -1
View File
@@ -353,7 +353,7 @@ def run_terminal(connection: socket.socket, username: str, rows: int, cols: int,
selector.modify(master, selectors.EVENT_READ | (selectors.EVENT_WRITE if pending else 0), "pty")
if _exited(process):
# Drain the leader's final output before terminating any background jobs.
while True:
for _ in range(16):
try:
data = os.read(master, MAX_TERMINAL_BYTES)
except (BlockingIOError, OSError):