Revert "sessions - remove CLI support (not used)"#296088
Merged
Conversation
This reverts commit ebeb2e6.
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @deepak1556Matched files:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Reverts prior removal of Sessions CLI support by reintroducing a --sessions flag that launches the Sessions window from the CLI and wiring it through argument parsing into the Electron main startup path.
Changes:
- Add
--sessionsto native CLI option descriptions andNativeParsedArgs. - Update macOS CLI launching logic to prefer launching an embedded app when
--sessionsis used. - Make Electron main open the Sessions window on startup when
--sessionsis present (or when running as an embedded app).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/vs/platform/environment/node/argv.ts | Re-adds --sessions to CLI option help/definitions. |
| src/vs/platform/environment/common/argv.ts | Extends NativeParsedArgs with sessions?: boolean. |
| src/vs/code/node/cli.ts | Adds macOS --sessions handling to launch an embedded app and adjusts argv passing. |
| src/vs/code/electron-main/app.ts | Opens Sessions window at startup when --sessions is provided. |
Comments suppressed due to low confidence (1)
src/vs/code/node/cli.ts:510
readdirSync(applicationsPath)can throw (e.g. permission/IO errors) even whenexistsSync(applicationsPath)is true, which would crash the CLI when--sessionsis used. Wrap the directory scan in a try/catch and handle failures gracefully (e.g. fall back to launching the main app, or emit an error that includes the underlying exception).
const contentsPath = dirname(dirname(process.execPath));
const applicationsPath = join(contentsPath, 'Applications');
const embeddedApp = existsSync(applicationsPath) && readdirSync(applicationsPath).find(f => f.endsWith('.app'));
if (embeddedApp) {
roblourens
approved these changes
Feb 18, 2026
meganrogge
pushed a commit
that referenced
this pull request
Feb 18, 2026
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.
Reverts #295801