From 76512c19c4ff4686ab2c0e2c3b7774ac25271564 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Sun, 22 Jun 2025 20:29:49 +0200 Subject: [PATCH] fix: Prevent double input processing in server sessions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The issue was that sendInput() was processing input twice: 1. Writing directly to PTY + asciinema for in-memory sessions 2. Then continuing to socket path which would write again Added early return after in-memory session processing to avoid the socket path when we already have a direct PTY reference. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- web/src/server/pty/pty-manager.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/web/src/server/pty/pty-manager.ts b/web/src/server/pty/pty-manager.ts index 66caef2f..45dc1333 100644 --- a/web/src/server/pty/pty-manager.ts +++ b/web/src/server/pty/pty-manager.ts @@ -515,6 +515,7 @@ export class PtyManager { if (memorySession?.ptyProcess) { memorySession.ptyProcess.write(dataToSend); memorySession.asciinemaWriter?.writeInput(dataToSend); + return; // Important: return here to avoid socket path } else { const sessionPaths = this.sessionManager.getSessionPaths(sessionId); if (!sessionPaths) {