This change introduces a new closeOnDisconnect client preference in the HTML terminal frontend and wires it into the xterm connection lifecycle. When enabled, the client now disables reconnect behavior and calls window.close() after the websocket closes, instead of showing the usual reconnect prompt. This is a small but useful UX improvement for embedded or popup terminal flows where a dead session should cleanly exit rather than linger.

Added a closeOnDisconnect HTML client option so terminal sessions can automatically close their browser window when the backend disconnects. - zhengqunkoo/ttyd