Page MenuHomeSolus

VSCode no url scheme protocol handler
Closed, ResolvedPublic

Description

Hello!
I found an issue with the vscode package that is shipped with Solus.
The issue is this: GitHub authentication via web browser does not work.
For example, extensions like GitHub Pull Requests or LiveShare do not work. The underlaying problem is that the package doesn't register vscode url-scheme-handler and also, it does not install the desktop handler application anywhere, as seen in: https://github.com/microsoft/vscode/issues/#issuecomment-1107529857

My fixes are these(they work, I tested them):
Add the file with the following details in /usr/share/applications
name: vscode-oss-url-handler.desktop
contents:

[Desktop Entry]
Name=Visual Studio Code URL Handler
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=code-oss --disable-crash-reporter --open-url %U
Icon=visual-studio-code
Type=Application
NoDisplay=true
StartupNotify=true
Categories=Utility;TextEditor;Development;IDE;
MimeType=x-scheme-handler/code-oss;

Run the following command post-install:

xdg-settings set default-url-scheme-handler vscode vscode-oss-url-handler.desktop

I tried to make a fix myself and open a PR but couldn't find a way to run a command post-install(Girtablulu said something about usysconf).

Revisions and Commits

Event Timeline

cata0309 edited subscribers, added: Restricted Project, Software; removed: Triage Team.Apr 30 2022, 9:27 PM
xdg-settings set default-url-scheme-handler vscode vscode-oss-url-handler.desktop

I think this is only needed if you have more than one x-scheme-handler/code-oss handler registered in the desktop database.

Well, there is no handler registered for that.

This comment was removed by cata0309.

@cata0309 what ReillyBrogan was trying to say is that simply adding it as a MimeType in the desktop file is enough because usysconf will automagically run update-desktop-database after package installation and thus register that handler.

Harvey added a subscriber: Harvey.

The line MimeType=x-scheme-handler/code-oss; should actually be MimeType=x-scheme-handler/vscode;

Reasoning:
That line is defining the protocol url which should be vscode:// if you have it set as MimeType=x-scheme-handler/code-oss; the protocol url is code-oss:// which is why its not working without running xdg-settings set default-url-scheme-handler vscode vscode-oss-url-handler.desktopwhich sets it correctly.

Fix incoming.