Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Linux URL handlers #48528

Closed
joaomoreno opened this issue Apr 24, 2018 · 6 comments · Fixed by #56727
Closed

Support Linux URL handlers #48528

joaomoreno opened this issue Apr 24, 2018 · 6 comments · Fixed by #56727
Assignees
Labels
electron Issues and items related to Electron feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities on-testplan workbench-os-integration Native OS integration issues

Comments

@joaomoreno
Copy link
Member

No description provided.

@joaomoreno joaomoreno added feature-request Request for new features or functionality electron Issues and items related to Electron workbench-os-integration Native OS integration issues labels Apr 24, 2018
@joaomoreno joaomoreno added this to the May 2018 milestone Apr 24, 2018
@joaomoreno joaomoreno self-assigned this Apr 24, 2018
@langpavel
Copy link

langpavel commented May 9, 2018

This may be useful as a hint: shengyou/vscode-handler#installing-on-linux
Please, take a two minutes to look into source, it may work only for open: https://github.com/shengyou/vscode-handler/blob/master/vscode-handler

@joaomoreno joaomoreno modified the milestones: May 2018, June 2018 May 29, 2018
@joaomoreno joaomoreno modified the milestones: June 2018, Backlog Jun 27, 2018
@segevfiner
Copy link
Contributor

shared-mime-info-spec - URI scheme handlers

I think adding a NoDisplay desktop file with MimeType=x-scheme-handler/vscode that launches VS Code with --open-url is what's needed to implement this.

@langpavel
Copy link

@segevfiner
Copy link
Contributor

segevfiner commented Aug 18, 2018

VS Code has native support for opening it's own URL scheme via the hidden --open-url argument, I don't think there is a need for wrapper script shenanigans.

I'm going to submit a PR.

@AmandaCameron
Copy link

AmandaCameron commented Aug 18, 2018 via email

@segevfiner
Copy link
Contributor

segevfiner commented Aug 18, 2018

I've not checked too far into it (Just subscribed to this to keep up to date) but the wrapper script is probably there because %u in the standard would include the "vscode://" prefix.

That's what should happen, that's what --open-url handles. 😃 You can test #56727 if you like. Alternatively you can test this (Which is what the PR adds):

For OSS:

[Desktop Entry]
Name=Code - OSS - URL Handler
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/share/code-oss/code-oss --open-url %U
Icon=code-oss
Type=Application
NoDisplay=true
StartupNotify=true
StartupWMClass=Code - OSS
Categories=Utility;TextEditor;Development;IDE;
MimeType=x-scheme-handler/vscode
Keywords=vscode;

For release version:

[Desktop Entry]
Name=Visual Studio Code - URL Handler
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/share/code/code --open-url %U
Icon=code
Type=Application
NoDisplay=true
StartupNotify=true
StartupWMClass=Code
Categories=Utility;TextEditor;Development;IDE;
MimeType=x-scheme-handler/vscode
Keywords=vscode;

Drop it into /usr/share/applications or ~/.local/share/applications and run update-desktop-database on that directory.

@joaomoreno joaomoreno added the help wanted Issues identified as good community contribution opportunities label Aug 20, 2018
@joaomoreno joaomoreno modified the milestones: Backlog, September 2018 Sep 13, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 28, 2018
lemanschik pushed a commit to code-oss-dev/code that referenced this issue Nov 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
electron Issues and items related to Electron feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities on-testplan workbench-os-integration Native OS integration issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants