https://bugs.kde.org/show_bug.cgi?id=501398

            Bug ID: 501398
           Summary: kde-open5 improperly parses URL-encoded spaces in
                    obsidian:// and other custom URI schemes
    Classification: Frameworks and Libraries
           Product: frameworks-kio
           Version: 6.11.0
          Platform: openSUSE
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: kio-bugs-n...@kde.org
          Reporter: k...@klub100.beer
                CC: kdelibs-b...@kde.org
  Target Milestone: ---

SUMMARY
kde-open5 incorrectly processes obsidian:// URLs (and potentially other custom
URI schemes) by stripping or incorrectly parsing %20 (space encoding) and
possibly other special characters.

This results in applications failing to open the correct resource when xdg-open
is used within a KDE environment.

The issue does not occur when using gio open, indicating that the bug is
KDE-specific.

STEPS TO REPRODUCE
1. Ensure that obsidian:// is registered as a valid x-scheme-handler (e.g., via
Flatpak:
/var/lib/flatpak/exports/share/applications/md.obsidian.Obsidian.desktop).
2. run xdg-open "obsidian://open?vault=obsidian-recipes&file=Shopping%20List"

OBSERVED RESULT
Instead of "Shopping List", kde-open5 passes "Shopping" as the file parameter.
This causes Obsidian to display an error: "Note 'Shopping' not found".
Debugging shows that kde-open5 truncates everything after the first space.

EXPECTED RESULT
Obsidian opens the correct note named "Shopping List" inside the vault
"obsidian-recipes".

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSUSE Tumbleweed
KDE Plasma Version: 6
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2

ADDITIONAL INFORMATION
Setting XDG_CURRENT_DESKTOP=GNOME makes xdg-open work correctly by using gio
open.

This works as expected (bypassing KDE utilities):
gio open "obsidian://open?vault=obsidian-recipes&file=Shopping%20List"
(Obsidian correctly opens Shopping List.)

This fails (when KDE takes over URL handling):
xdg-open "obsidian://open?vault=obsidian-recipes&file=Shopping%20List"
(Results in Obsidian searching for Shopping instead of Shopping List.)

xdg-open Debug Output (showing KDE is involved):
XDG_UTILS_DEBUG_LEVEL=2 xdg-open
"obsidian://open?vault=obsidian-recipes&file=Shopping%20List"
Selected DE kde
Received callback URL obsidian://open?vault=obsidian-recipes&file=Shopping
(Note how the received callback URL has stripped everything after the first
space!)

Strace output confirming kde-open5 is used:
strace -f -e execve xdg-open
"obsidian://open?vault=obsidian-recipes&file=Shopping%20List"
execve("/usr/bin/xdg-open", ["xdg-open",
"obsidian://open?vault=obsidian-r"...], ...)
execve("/usr/bin/kde-open5", ["kde-open5",
"obsidian://open?vault=obsidian-r"...], ...)
(kde-open5 is modifying the URL before passing it forward.)

Possible Cause:
kde-open5 might be incorrectly splitting the URL on spaces instead of properly
handling URL encoding.
gio open does not have this issue, indicating the problem is KDE-specific.

Impact:
Affects any application relying on URL schemes (obsidian://, potentially
vscode://, tg://, etc.).
Affects all KDE users relying on xdg-open to launch URL handlers.
Forces KDE users to set XDG_CURRENT_DESKTOP=GNOME as a workaround.

Suggested Fix:
kde-open5 should respect encoded URLs (%20 should not be removed).
The full URL should be passed to applications unmodified.

Workarounds:
gio open "obsidian://open?vault=obsidian-recipes&file=Shopping%20List"
XDG_CURRENT_DESKTOP=GNOME xdg-open
"obsidian://open?vault=obsidian-recipes&file=Shopping%20List"

Related Issues & Discussions:
Flatpak .desktop file for Obsidian is correctly set up (Exec=/usr/bin/flatpak
run ...).
Bug only happens in KDE, not GNOME/Xfce (which use gio open).

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to