Skip to content

Commit 1b5a56b

Browse files
authored
Restore close and shutdown confirmation dialog
1 parent 43b8cce commit 1b5a56b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

packages/notebook-extension/src/index.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,15 @@ const closeTab: JupyterFrontEndPlugin<void> = {
163163
commands.addCommand(id, {
164164
label: trans.__('Close and Shut Down Notebook'),
165165
execute: async () => {
166-
// Shut the kernel down, without confirmation
167-
await commands.execute('notebook:shutdown-kernel', { activate: false });
168-
window.close();
166+
const confirm = window.confirm(
167+
trans.__('Are you sure you want to close and shut down the notebook?')
168+
);
169+
if (confirm) {
170+
await commands.execute('notebook:shutdown-kernel', {
171+
activate: false,
172+
});
173+
window.close();
174+
}
169175
},
170176
});
171177
menu.fileMenu.closeAndCleaners.add({

0 commit comments

Comments
 (0)