We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f10c5f commit 679b0e9Copy full SHA for 679b0e9
src/client.ts
@@ -205,6 +205,12 @@ async function createTerminal(
205
const debouncedUpdateTerminalSize = debounce(() => updateTerminalSize(term), 200, { trailing: true });
206
window.onresize = () => debouncedUpdateTerminalSize();
207
208
+ // Ask for confirmation before closing the current terminal session
209
+ window.onbeforeunload = (event) => {
210
+ event.preventDefault();
211
+ event.returnValue = "really?"; // supporting legacy browsers
212
+ };
213
+
214
// Register the onclick event for the reconnect button
215
reconnectButton.onclick = () => terminalSocket.reconnect();
216
0 commit comments