connectWebSocket set ws.onopen to send the shell init payload, but initTerminal immediately overwrote it with a state-only handler. Switched to addEventListener so both handlers coexist.
connectWebSocket set ws.onopen to send the shell init payload, but initTerminal immediately overwrote it with a state-only handler. Switched to addEventListener so both handlers coexist.