Repository navigation
Keep the last project when the Dock opens a projectless window - #18807
Merged
Merged
Conversation
The Dock's "New RStudio Window" (#18786) asks the session for no project by setting RS_INITIAL_PROJECT=none. The session handled that value the same way as a "--project none" scope: through resolveProjectSwitch(), which also flushes the per-user last-project path. That record is shared by every window, so the new empty window erased the project remembered for the window it was launched from. With "Restore most recently opened project at startup" on, the original project was then not reopened on the next launch if that window crashed or the empty window quit last. Handle the desktop's env-var "none" as a plain projectless start and leave the last project path alone. The command-line scope keeps its flush. Addresses #15669 Claude-Session: https://claude.ai/code/session_01HG3TvVKHo57As36tpZx2T8
launchRStudio() set RS_INITIAL_PROJECT and RS_INITIAL_WD in this process's environment around the spawn call and unset them afterwards, which also wiped whatever values this instance was started with. Build the child's environment as a copy and hand it to spawn, leaving our own untouched. Make LaunchRStudioOptions a union of the three launch intents (a project file, a working directory, or no project) so a caller can't combine them, and branch on the intent directly rather than deriving the working directory and project file through nested fallbacks. Claude-Session: https://claude.ai/code/session_01HG3TvVKHo57As36tpZx2T8
gtritchie
temporarily deployed
to
e2e-playwright
September 13, 2026 17:30 — with
GitHub Actions
Inactive
gtritchie
temporarily deployed
to
e2e-playwright
September 13, 2026 17:30 — with
GitHub Actions
Inactive
gtritchie
temporarily deployed
to
e2e-playwright
September 13, 2026 17:32 — with
GitHub Actions
Inactive
gtritchie
had a problem deploying
to
e2e-playwright
September 13, 2026 17:32 — with
GitHub Actions
Failure
gtritchie
temporarily deployed
to
e2e-playwright
September 13, 2026 17:33 — with
GitHub Actions
Inactive
gtritchie
had a problem deploying
to
e2e-playwright
September 13, 2026 17:33 — with
GitHub Actions
Failure
gtritchie
temporarily deployed
to
e2e-playwright
September 13, 2026 17:36 — with
GitHub Actions
Inactive
gtritchie
temporarily deployed
to
e2e-playwright
September 13, 2026 17:36 — with
GitHub Actions
Inactive
gtritchie
temporarily deployed
to
e2e-playwright
September 13, 2026 17:36 — with
GitHub Actions
Inactive
gtritchie
temporarily deployed
to
e2e-playwright
September 13, 2026 17:36 — with
GitHub Actions
Inactive
gtritchie
temporarily deployed
to
e2e-playwright
September 13, 2026 17:36 — with
GitHub Actions
Inactive
gtritchie
temporarily deployed
to
e2e-playwright
September 13, 2026 17:36 — with
GitHub Actions
Inactive
RStudio E2E - all platformsAll tests passed!
View / download the full reportView report online -- opens in the browser, no download needed. Available for 14 days. Download playwright-report.zip -- extract and open
All platforms - commit |
…w-keeps-last-project
gtritchie
temporarily deployed
to
e2e-playwright
September 13, 2026 19:48 — with
GitHub Actions
Inactive
gtritchie
temporarily deployed
to
e2e-playwright
September 13, 2026 19:48 — with
GitHub Actions
Inactive
gtritchie
temporarily deployed
to
e2e-playwright
September 13, 2026 19:53 — with
GitHub Actions
Inactive
gtritchie
temporarily deployed
to
e2e-playwright
September 13, 2026 19:53 — with
GitHub Actions
Inactive
gtritchie
temporarily deployed
to
e2e-playwright
September 13, 2026 19:57 — with
GitHub Actions
Inactive
gtritchie
temporarily deployed
to
e2e-playwright
September 13, 2026 19:57 — with
GitHub Actions
Inactive
gtritchie
temporarily deployed
to
e2e-playwright
September 13, 2026 19:59 — with
GitHub Actions
Inactive
gtritchie
temporarily deployed
to
e2e-playwright
September 13, 2026 19:59 — with
GitHub Actions
Inactive
gtritchie
temporarily deployed
to
e2e-playwright
September 13, 2026 19:59 — with
GitHub Actions
Inactive
gtritchie
temporarily deployed
to
e2e-playwright
September 13, 2026 19:59 — with
GitHub Actions
Inactive
gtritchie
temporarily deployed
to
e2e-playwright
September 13, 2026 19:59 — with
GitHub Actions
Inactive
gtritchie
temporarily deployed
to
e2e-playwright
September 13, 2026 19:59 — with
GitHub Actions
Inactive
This branch was previously deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #18786. The Dock's "New RStudio Window" asks the session for no project with
RS_INITIAL_PROJECT=none, and the session treated that like a--project nonescope: it went throughresolveProjectSwitch(), which also flushes the per-user last-project path. That record is shared by all windows, so the new empty window erased the project remembered for the window it was launched from. With "Restore most recently opened project at startup" on, the original project was not reopened on the next launch if that window crashed or the empty window was quit last.The session now handles the desktop's env-var
noneas a plain projectless start and leaves the last project path alone. The command-line scope, used by Workbench, keeps its flush. Thenoneenv value is only ever sent by the Dock command, so no other startup path changes.Also on the desktop side, from the review of #18786:
launchRStudio()builds the child's environment as a copy and passes it tospawn, instead of setting and unsetting variables in this process's own environment.LaunchRStudioOptionsis a union of the three launch intents (project file, working directory, no project), so callers can't combine them, and the function branches on the intent directly.No NEWS entry: #18786 is unreleased.
Verification
Desktop unit tests cover the three launch intents and that an inherited project is not passed on. Lint and typecheck are clean. The session change needs a person:
Addresses #15669