Describe the bug
The Linux desktop entry generated by tauri-bundler declares MimeType=x-scheme-handler/<scheme> for configured deep-link schemes, but renders Exec={{exec}} without any field code (%u/%U). Per the freedesktop Desktop Entry specification, an entry whose Exec line has no field code is launched without the URL it was asked to open.
Consequence: when the OS resolves a deep link through the packaged desktop entry (browser → xdg-open / portal → x-scheme-handler association), the application is launched without the URL. The deep link silently vanishes — no error anywhere. For OAuth/OIDC flows this means the callback never reaches the app, and sign-in cannot complete through the system handler.
The runtime-registered handler that tauri-plugin-deep-link's register_all() writes to ~/.local/share/applications/<app>-handler.desktop does include %u, which masks the bug in dev setups. But desktop portals (e.g. xdg-desktop-portal-kde) exclude that NoDisplay=true entry from app choosers and may resolve to the packaged entry instead — which then drops the URL. This is how we hit it in production: KDE Plasma + Chrome, packaged deb, OAuth callback lost (reproduced and worked around here).
The template is unchanged on dev:
https://github.com/tauri-apps/tauri/blob/dev/crates/tauri-bundler/src/bundle/linux/freedesktop/main.desktop
Exec={{exec}}
...
{{#if mime_type}}
MimeType={{mime_type}}
{{/if}}
The entry declaring URL-scheme handling while dropping URLs is self-contradictory; the bundler already knows deep-link schemes are configured (it writes them into MimeType), so it has enough information to emit a field code.
Reproduction
- Configure
plugins.deep-link.desktop.schemes = ["my-scheme"] and build a deb/rpm/AppImage.
- Install; confirm
/usr/share/applications/<App>.desktop contains MimeType=x-scheme-handler/my-scheme and Exec=<binary> with no %u.
gio open "my-scheme:/test?x=1" (or click such a link in a browser under a portal-based desktop).
- The app launches (or forwards via single-instance) with no URL in argv —
deep_link().get_current() is empty.
Workaround: a custom desktopTemplate with Exec={{exec}} %u.
Expected behavior
The generated desktop entry passes the URL through, e.g. Exec={{exec}} %u (or an exec_arg variable computed by the bundler: %u when deep-link schemes are configured, %F/%U when file associations are configured, empty otherwise — mirroring what the NSIS/Windows and macOS bundlers already achieve via their native URL-activation mechanisms).
Full tauri info output
tauri-bundler 2.9.2 (via @tauri-apps/cli 2.11.2), tauri 2.x
Host: Arch Linux, KDE Plasma 6.7.4 (Wayland), xdg-desktop-portal-kde
Also verified against the template on the current `dev` branch.
Stack trace
No crash — the URL is silently dropped by the desktop launcher.
Describe the bug
The Linux desktop entry generated by tauri-bundler declares
MimeType=x-scheme-handler/<scheme>for configured deep-link schemes, but rendersExec={{exec}}without any field code (%u/%U). Per the freedesktop Desktop Entry specification, an entry whose Exec line has no field code is launched without the URL it was asked to open.Consequence: when the OS resolves a deep link through the packaged desktop entry (browser → xdg-open / portal →
x-scheme-handlerassociation), the application is launched without the URL. The deep link silently vanishes — no error anywhere. For OAuth/OIDC flows this means the callback never reaches the app, and sign-in cannot complete through the system handler.The runtime-registered handler that
tauri-plugin-deep-link'sregister_all()writes to~/.local/share/applications/<app>-handler.desktopdoes include%u, which masks the bug in dev setups. But desktop portals (e.g. xdg-desktop-portal-kde) exclude thatNoDisplay=trueentry from app choosers and may resolve to the packaged entry instead — which then drops the URL. This is how we hit it in production: KDE Plasma + Chrome, packaged deb, OAuth callback lost (reproduced and worked around here).The template is unchanged on
dev:https://github.com/tauri-apps/tauri/blob/dev/crates/tauri-bundler/src/bundle/linux/freedesktop/main.desktop
The entry declaring URL-scheme handling while dropping URLs is self-contradictory; the bundler already knows deep-link schemes are configured (it writes them into MimeType), so it has enough information to emit a field code.
Reproduction
plugins.deep-link.desktop.schemes=["my-scheme"]and build a deb/rpm/AppImage./usr/share/applications/<App>.desktopcontainsMimeType=x-scheme-handler/my-schemeandExec=<binary>with no%u.gio open "my-scheme:/test?x=1"(or click such a link in a browser under a portal-based desktop).deep_link().get_current()is empty.Workaround: a custom
desktopTemplatewithExec={{exec}} %u.Expected behavior
The generated desktop entry passes the URL through, e.g.
Exec={{exec}} %u(or anexec_argvariable computed by the bundler:%uwhen deep-link schemes are configured,%F/%Uwhen file associations are configured, empty otherwise — mirroring what the NSIS/Windows and macOS bundlers already achieve via their native URL-activation mechanisms).Full
tauri infooutputStack trace
No crash — the URL is silently dropped by the desktop launcher.