You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Shutting down a language runtime is a destructive operation; you lose anything in your environment you haven't saved, as well as any UI that can't survive without a backend (resizable plots, data viewers, etc). However, this operation has no confirmation and also can't be undone, so it's too easy to lose data as things stand today.
There are a few ways we could address this.
Always prompt for confirmation before shutting down.
Require language runtimes to supply a method that can be used to determine whether the workspace contains unsaved changes. When the user requests shutdown, call this method; without unsaved changes, proceed to shut down; with them, prompt to shut down.
As above, but require the language runtime to supply richer data and/or a message to present to the user instead of a boolean dirty/not dirty flag.
Add a onShutdownRequested method to language runtimes that gives them a hook to handle shutdown requests before an actual shutdown happens.
Do nothing at the Positron level; let language runtimes themselves decide what to do with a shutdown request. The shutdown() method is async, so they can prompt the user if they want to and remain in full control over the experience (so long as they only use the extension API)
The text was updated successfully, but these errors were encountered:
An argument for letting language runtimes drive the shutdown is that they might also want to offer to save state before shutdown, but that's a pretty language-dependent workflow which doesn't feel like something we want to try to plumb all the way through the top-level language runtime API.
I see that "or restart" is mentioned in the title. I don't think I would want CMD+SHIFT+0 to prompt me for some kind of additional confirmation about doing a restart. I wholly accept that I am going to lose objects in the global env when I do that (in fact it is often one of the reasons I do a restart in the first place), and I want that to be a fast operation.
In terms of plumbing, we could probably use the UI comm as a way to have Positron do things like ask the user to confirm quit, and return the user's answer.
Shutting down a language runtime is a destructive operation; you lose anything in your environment you haven't saved, as well as any UI that can't survive without a backend (resizable plots, data viewers, etc). However, this operation has no confirmation and also can't be undone, so it's too easy to lose data as things stand today.
There are a few ways we could address this.
onShutdownRequested
method to language runtimes that gives them a hook to handle shutdown requests before an actual shutdown happens.shutdown()
method is async, so they can prompt the user if they want to and remain in full control over the experience (so long as they only use the extension API)The text was updated successfully, but these errors were encountered: