diff --git a/AppImage/components/script-terminal-modal.tsx b/AppImage/components/script-terminal-modal.tsx index e6c1238..78ab7ec 100644 --- a/AppImage/components/script-terminal-modal.tsx +++ b/AppImage/components/script-terminal-modal.tsx @@ -225,6 +225,12 @@ export function ScriptTerminalModal({ }} onWebInteraction={handleWebInteraction} onWebSocketCreated={handleWebSocketCreated} + onTerminalOutput={() => { + setIsWaitingNextInteraction(false) + if (waitingTimeoutRef.current) { + clearTimeout(waitingTimeoutRef.current) + } + }} isScriptModal={true} /> diff --git a/AppImage/components/terminal-panel.tsx b/AppImage/components/terminal-panel.tsx index 3806e58..49a9be9 100644 --- a/AppImage/components/terminal-panel.tsx +++ b/AppImage/components/terminal-panel.tsx @@ -29,6 +29,7 @@ type TerminalPanelProps = { initMessage?: Record onWebInteraction?: (interaction: any) => void onWebSocketCreated?: (ws: WebSocket) => void + onTerminalOutput?: () => void isScriptModal?: boolean } @@ -142,6 +143,7 @@ export function TerminalPanel({ initMessage, onWebInteraction, onWebSocketCreated, + onTerminalOutput, isScriptModal = false, }: TerminalPanelProps) { const [terminals, setTerminals] = useState([]) @@ -460,6 +462,10 @@ export function TerminalPanel({ // Not JSON, it's regular terminal output } + if (onTerminalOutput) { + onTerminalOutput() + } + term.write(event.data) }