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

Comments

@joaomoreno
Copy link
Member

commented Apr 24, 2018

No description provided.

@langpavel

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor

commented Aug 16, 2018

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

This comment has been minimized.

@segevfiner

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link

commented Aug 18, 2018

@segevfiner

This comment has been minimized.

Copy link
Contributor

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 modified the milestones: Backlog, September 2018 Sep 13, 2018

@joaomoreno joaomoreno referenced this issue Sep 24, 2018
1 of 1 task complete

@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 28, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.