fix: close terminal websocket when local container shell exits

This commit is contained in:
Mauricio Siu
2026-08-28 15:50:53 -06:00
parent 355b856185
commit 1053743a1c
@@ -182,6 +182,10 @@ export const setupDockerContainerTerminalWebSocketServer = (
ptyProcess.onData((data) => {
ws.send(data);
});
ptyProcess.onExit(({ exitCode }) => {
ws.send(`\nContainer closed with code: ${exitCode}\n`);
ws.close();
});
ws.on("close", () => {
ptyProcess.kill();
});