-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide predictable startup ordering (#5959)
This change eliminates the disorienting startup experience that can occur when multiple affiliated runtimes exist (or multiple sessions are running). Prior to the change, every runtime start or reconnect resulted in the new session taking over the Console and Variables panes and becoming the active session. Practically speaking this meant that startup often showed some flickering as different sessions booted and Positron switched between them on its own, and the session you wound up with when startup was finished might not be the one you wanted or expected. After the change, sessions and affiliated runtimes are ordered, and only one console session gets to become active. The other sessions are still started -- they just start in the background. The result is (hopefully) a calmer startup experience. Right now, there is no explicit ordering -- we just go by whichever one was last used. So if you were using Python when you exited, that's what you should see when you open Positron again; same deal with R. The implementation works as follows: - plumb an `activate` flag everywhere we deal with session start events to keep track of whether the session should be focused/activated after it starts - remember the last used time for both sessions (for reconnect/reload) and affiliations (for new windows) - start/reconnect to sessions in descending order of last use (i.e. most recent first) - at startup, only flag sessions to `activate` if they are the most recently used Addresses #1044 and part of #1143. ### Release Notes #### New Features - When multiple languages are being used, prioritize the most recent one at startup (#1044.) #### Bug Fixes - N/A ### QA Notes - Both affiliations (for new windows) and sessions (for reloading existing windows) should be checked. - For a runtime to become the "last used runtime", you generally need to make a gesture that you want to use the runtime, such as switching to it in the Console or running some code in the Console --------- Signed-off-by: Jonathan <[email protected]> Co-authored-by: sharon <[email protected]> Co-authored-by: positron-bot[bot] <173392469+positron-bot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
d625154
commit b0ba2b3
Showing
17 changed files
with
448 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.