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:
parent
9f0438b540
commit
2ad9a742dd
7 changed files with 177 additions and 41 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue