Skip to content

Provide a CLI option that can open a URL in a browser page  #3992

Closed
@egamma

Description

@egamma

Currently node CLI apps that use the opn to open a browser do not work when run in a remote context.

To support this, the code CLI available in a remote context should provide a CLI option/command (e.g. code-open) that opens a URL in the local browser from the locally running VS Code .

The opn module which uses the xdg-open utility supports a BROWSER environment variable. BROWSER is a similar environment variable like EDITOR, it contains the path to the web browser. Now, when a remote context defines this environment variable BROWSER with the code command, then the opn module also works in the remote context.

Test case:

  1. npx create-react-app my-app
  2. cd my-app
  3. npm start

This should open the webpage for the react app in a browser.

Metadata

Metadata

Assignees

Labels

remoteIssues in the code server support

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions