From f6fb984ec653d5acccd0237f8aa891f90784bdcc Mon Sep 17 00:00:00 2001 From: Fusion Date: Sun, 24 May 2026 16:00:25 +0200 Subject: [PATCH] revert: remove SIGWINCH signal that caused connection loops Sending SIGWINCH to the docker exec process was crashing/killing it, which closed the PTY and caused WebSocket 1006 abnormal closure loops. Reverting to the original TIOCSWINSZ-only approach. --- apps/api/src/services/terminal_session.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/apps/api/src/services/terminal_session.py b/apps/api/src/services/terminal_session.py index 76ec714..d4e504e 100644 --- a/apps/api/src/services/terminal_session.py +++ b/apps/api/src/services/terminal_session.py @@ -5,7 +5,6 @@ import logging import os import pty import select -import signal import struct import fcntl import time @@ -84,7 +83,7 @@ class TerminalSession: self.last_activity = time.time() def _set_terminal_size(self, cols: int, rows: int) -> None: - """Set the terminal size using TIOCSWINSZ and signal docker exec.""" + """Set the terminal size using TIOCSWINSZ.""" if self._master_fd is None: logger.warning("Cannot resize: master_fd is None (session not started)") return @@ -94,15 +93,6 @@ class TerminalSession: try: fcntl.ioctl(self._master_fd, TIOCSWINSZ, size) logger.info(f"Resized PTY to {cols}x{rows} (fd={self._master_fd})") - - # Send SIGWINCH to docker exec process so it re-reads terminal - # size and propagates it to the container's PTY - if self.process and self.process.pid: - try: - os.kill(self.process.pid, signal.SIGWINCH) - logger.info(f"Sent SIGWINCH to docker exec pid={self.process.pid}") - except (OSError, ProcessLookupError) as e: - logger.warning(f"Failed to send SIGWINCH: {e}") except (OSError, IOError) as e: logger.error(f"Failed to resize PTY: {e}")