repl: Add restart kernel action and improve shutdown (#16609)

- Implement restart kernel functionality
- Clean up shutdown process to properly drop messaging and exit status
tasks
- Refactor kernel state handling for better consistency

Closes #16037

Release Notes:

- repl: Added restart kernel action
- repl: Fixed issue with shutting down kernels that are in a failure
state
This commit is contained in:
Kyle Kelley 2024-08-21 11:51:58 -07:00 committed by GitHub
parent 9f0438b540
commit 2ad9a742dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 177 additions and 41 deletions

View file

@ -23,6 +23,7 @@ actions!(
Sessions,
Interrupt,
Shutdown,
Restart,
RefreshKernelspecs
]
);
@ -126,6 +127,19 @@ pub fn init(cx: &mut AppContext) {
}
})
.detach();
editor
.register_action({
let editor_handle = editor_handle.clone();
move |_: &Restart, cx| {
if !JupyterSettings::enabled(cx) {
return;
}
crate::restart(editor_handle.clone(), cx);
}
})
.detach();
})
.detach();
}