Skip to content

Revert "sessions - remove CLI support (not used)"#296088

Merged
bpasero merged 2 commits intomainfrom
revert-295801-ben/wispy-mole
Feb 18, 2026
Merged

Revert "sessions - remove CLI support (not used)"#296088
bpasero merged 2 commits intomainfrom
revert-295801-ben/wispy-mole

Conversation

@bpasero
Copy link
Member

@bpasero bpasero commented Feb 18, 2026

Reverts #295801

Copilot AI review requested due to automatic review settings February 18, 2026 19:39
@bpasero bpasero added this to the February 2026 milestone Feb 18, 2026
@bpasero bpasero self-assigned this Feb 18, 2026
@vs-code-engineering
Copy link

vs-code-engineering bot commented Feb 18, 2026

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@deepak1556

Matched files:

  • src/vs/code/electron-main/app.ts

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --sessions to native CLI option descriptions and NativeParsedArgs.
  • Update macOS CLI launching logic to prefer launching an embedded app when --sessions is used.
  • Make Electron main open the Sessions window on startup when --sessions is 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 when existsSync(applicationsPath) is true, which would crash the CLI when --sessions is 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) {

@bpasero bpasero marked this pull request as draft February 18, 2026 19:47
@bpasero bpasero marked this pull request as ready for review February 18, 2026 19:51
@bpasero bpasero enabled auto-merge (squash) February 18, 2026 19:51
@bpasero bpasero merged commit 4f18509 into main Feb 18, 2026
28 of 29 checks passed
@bpasero bpasero deleted the revert-295801-ben/wispy-mole branch February 18, 2026 20:45
meganrogge pushed a commit that referenced this pull request Feb 18, 2026
* Revert "sessions - remove CLI support (not used) (#295801)"

This reverts commit ebeb2e6.

* reduce change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments