Change:
This may be useful as a hint: Please, take a two minutes to look into source, it may work only for :
I think adding a desktop file with that launches VS Code with is what's needed to implement this.
nice relevant gist:
VS Code has native support for opening it's own URL scheme via the hidden argument, I don't think there is a need for wrapper script shenanigans. I'm going to submit a PR.
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 in the standard would include the "vscode://" prefix.
That's what should happen, that's what handles. :smiley: You can test if you like. Alternatively you can test this (Which is what the PR adds): For OSS: For release version: Drop it into or and run on that directory.

Discussion:
.pipe(replace('@@ICON@@', product.applicationName)) .pipe(rename('usr/share/applications/' + product.applicationName + '.desktop')); <ins> const desktopUrlHandler = gulp.src('resources/linux/code-url-handler.desktop', { base: '.' }) .pipe(replace('@@NAME_LONG@@', product.nameLong)) .pipe(replace('@@NAME_SHORT@@', product.nameShort)) .pipe(replace('@@NAME@@', product.applicationName)) .pipe(replace('@@ICON@@', product.applicationName)) .pipe(rename('usr/share/applications/' + product.applicationName + '-url-handler.desktop')); </ins> const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' }) .pipe(replace('@@NAME_LONG@@', product.nameLong)) .pipe(replace('@@NAME@@', product.applicationName))

.pipe(replace('@@UPDATEURL@@', product.updateUrl || '@@UPDATEURL@@')) .pipe(rename('DEBIAN/postinst')); <del> const all = es.merge(control, postinst, postrm, prerm, desktop, appdata, icon, code); </del> <ins> const all = es.merge(control, postinst, postrm, prerm, desktop, desktopUrlHandler, appdata, icon, code); </ins> return all.pipe(vfs.dest(destination)); };

.pipe(replace('@@ICON@@', product.applicationName)) .pipe(rename('BUILD/usr/share/applications/' + product.applicationName + '.desktop')); <ins> const desktopUrlHandler = gulp.src('resources/linux/code-url-handler.desktop', { base: '.' }) .pipe(replace('@@NAME_LONG@@', product.nameLong)) .pipe(replace('@@NAME_SHORT@@', product.nameShort)) .pipe(replace('@@NAME@@', product.applicationName)) .pipe(replace('@@ICON@@', product.applicationName)) .pipe(rename('BUILD/usr/share/applications/' + product.applicationName + '-url-handler.desktop')); </ins> const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' }) .pipe(replace('@@NAME_LONG@@', product.nameLong)) .pipe(replace('@@NAME@@', product.applicationName))

const specIcon = gulp.src('resources/linux/rpm/code.xpm', { base: '.' }) .pipe(rename('SOURCES/' + product.applicationName + '.xpm')); <del> const all = es.merge(code, desktop, appdata, icon, spec, specIcon); </del> <ins> const all = es.merge(code, desktop, desktopUrlHandler, appdata, icon, spec, specIcon); </ins> return all.pipe(vfs.dest(getRpmBuildPath(rpmArch))); };

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

# Install the desktop entry if hash desktop-file-install 2>/dev/null; then desktop-file-install /usr/share/applications/@@NAME@@.desktop <ins> desktop-file-install /usr/share/applications/@@NAME@@-url-handler.desktop </ins> fi if [ "@@NAME@@" != "code-oss" ]; then

mkdir -p %{buildroot}/usr/share/pixmaps cp -r usr/share/@@NAME@@/* %{buildroot}/usr/share/@@NAME@@ cp -r usr/share/applications/@@NAME@@.desktop %{buildroot}/usr/share/applications <ins> cp -r usr/share/applications/@@NAME@@-url-handler.desktop %{buildroot}/usr/share/applications </ins> cp -r usr/share/pixmaps/@@NAME@@.png %{buildroot}/usr/share/pixmaps %post

/usr/share/@@NAME@@/ /usr/share/applications/@@NAME@@.desktop <ins> /usr/share/applications/@@NAME@@-url-handler.desktop </ins> /usr/share/pixmaps/@@NAME@@.png