FS#63250 - [code] not possible to launch using 'vscode://' prefixed URL
Attached to Project:
Community Packages
Opened by Valantis Trigonis (valtrig) - Monday, 22 July 2019, 10:07 GMT
Last edited by Massimiliano Torromeo (mtorromeo) - Friday, 28 April 2023, 14:15 GMT
Opened by Valantis Trigonis (valtrig) - Monday, 22 July 2019, 10:07 GMT
Last edited by Massimiliano Torromeo (mtorromeo) - Friday, 28 April 2023, 14:15 GMT
|
Details
Description: After installation, attempting to launch the
application via a 'vscode://' prefixed URL fails, due to
invalid content of the
'/usr/share/applications/code-oss-url-handler.desktop' file.
Specifically, the file contains a variable named
@@URLPROTOCOL@@ which is not being replaced by the proper
value, i.e. 'vscode', during installation.
Adding 's|@@URLPROTOCOL@@|vscode|g' to the relevant 'sed' invocation section in PKGBUILD should do the trick! Additional info: * package version: 1.36.1-1 * original feature request in upstream: https://github.com/Microsoft/vscode/issues/48528 * documentation: https://code.visualstudio.com/docs/editor/command-line#_opening-vs-code-with-urls Steps to reproduce: # echo 'this is a test' > /tmp/test # xdg-open vscode://file/tmp/test gio: vscode://file/tmp/test: The specified location is not supported # sudo update-desktop-database Error in file "/usr/share/applications/code-oss-url-handler.desktop": "x-scheme-handler/@@URLPROTOCOL@@" is an invalid MIME type ("x-scheme-handler/@@URLPROTOCOL@@" contains an invalid character in the subtype) |
This task depends upon
Closed by Massimiliano Torromeo (mtorromeo)
Friday, 28 April 2023, 14:15 GMT
Reason for closing: Fixed
Additional comments about closing: code-1.77.3-2
Friday, 28 April 2023, 14:15 GMT
Reason for closing: Fixed
Additional comments about closing: code-1.77.3-2
The correct value to replace `@@URLPROTOCOL@@` with depends on what is set for `urlProtocol` in the product.json - since this is currently not being touched this would be the default scheme `code-oss`.
There have been relatively recent changes in the handling of the (GitHub) auth flow for the `code-oss` scheme specifically due to issues on Windows (https://github.com/microsoft/vscode/commit/b1fb11e18cbdd3aba09e4aef0b4be07c0731d86f), making the default slightly less ideal. I thus suggest either changing the `urlProtocol` in `product.json` to `vscode` and removing the added `sed` call again or making `code-oss` the main replacement string and adding a second scheme handler in addition so that the desktop entry then contains `MimeType=x-scheme-handler/code-oss;x-scheme-handler/vscode;`.