From a663b83daa20e4c94e15a6c8735fe9bc67d3f9e4 Mon Sep 17 00:00:00 2001 From: MacRimi Date: Fri, 10 Apr 2026 09:07:57 +0200 Subject: [PATCH] Update script-terminal-modal.tsx --- AppImage/components/script-terminal-modal.tsx | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/AppImage/components/script-terminal-modal.tsx b/AppImage/components/script-terminal-modal.tsx index f2b6eea5..6068a57b 100644 --- a/AppImage/components/script-terminal-modal.tsx +++ b/AppImage/components/script-terminal-modal.tsx @@ -138,6 +138,11 @@ const initMessage = { } ws.onmessage = (event) => { + // Filter out pong responses from heartbeat + if (event.data === '{"type": "pong"}' || event.data === '{"type":"pong"}') { + return + } + try { const msg = JSON.parse(event.data) if (msg.type === "web_interaction" && msg.interaction) { @@ -282,14 +287,11 @@ const initMessage = { } }, 30000) - // Small delay to ensure paramsRef is updated with latest props - setTimeout(() => { - const initMessage = { - script_path: scriptPath, - params: paramsRef.current, - } - ws.send(JSON.stringify(initMessage)) - }, 50) + const initMessage = { + script_path: scriptPath, + params: paramsRef.current, + } + ws.send(JSON.stringify(initMessage)) setTimeout(() => { if (fitAddonRef.current && termRef.current && ws.readyState === WebSocket.OPEN) { @@ -307,6 +309,11 @@ const initMessage = { } ws.onmessage = (event) => { + // Filter out pong responses from heartbeat - don't display in terminal + if (event.data === '{"type": "pong"}' || event.data === '{"type":"pong"}') { + return + } + try { const msg = JSON.parse(event.data)