Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore close and shutdown confirmation dialog #7430

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions packages/notebook-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,15 @@ const closeTab: JupyterFrontEndPlugin<void> = {
commands.addCommand(id, {
label: trans.__('Close and Shut Down Notebook'),
execute: async () => {
// Shut the kernel down, without confirmation
await commands.execute('notebook:shutdown-kernel', { activate: false });
window.close();
const confirm = window.confirm(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sai-chand04 for working on this.

As discussed in #7398, the idea was to introduce a setting to let users override the default behavior. Which does not seem to be the case here for now.

trans.__('Are you sure you want to close and shut down the notebook?')
);
if (confirm) {
await commands.execute('notebook:shutdown-kernel', {
activate: false,
});
window.close();
}
},
});
menu.fileMenu.closeAndCleaners.add({
Expand Down
Loading