Fix transparent websocket recovery for terminals

Close retired websocket connections in stopWSClient so clients reconnect promptly instead of remaining in a stdin-only state with no returning output. Add regression coverage to verify stopWSClient actively disconnects the websocket.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
GitHub Copilot
2026-02-17 09:50:26 +00:00
parent 62bab56589
commit 3b5f36d239
2 changed files with 45 additions and 0 deletions
+3
View File
@@ -343,6 +343,9 @@ func (s *LocalServer) stopWSClient(routeKey string, expected *wsClient) {
return
}
close(client.send)
if client.conn != nil {
_ = client.conn.Close()
}
<-client.done
}