SUMMARY Added by hands application in system menu with space in path cannot be invoked to open a file with that application. STEPS TO REPRODUCE 1. Add a new application by hands in system menu with space in a path to a executable. 2. Assign this new application to open some file type with its. 3. Double click on that file type in Dolphin or Krusader. OBSERVED RESULT You will see a message that application cannot be found. EXPECTED RESULT Application should being launched and open selected file. SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: KDE neon 5.27 (available in About System) KDE Plasma Version: 5.27.8 KDE Frameworks Version: 5.110.0 Qt Version: 5.15.10 ADDITIONAL INFORMATION
When you write out a file path by hand, it's up to you to ensure that spaces and other historically special characters are escaped properly, or that the path is quoted.
You are wrong! I didn't write path by hands, I did it with "Menu Editor", I added new menu entry by hands, but I set path to executable with file dialog!!!
I will record a GIF, give me some time.
GIF poof - https://i.ibb.co/TMpR2B9/bug.gif
*proof :)
Ok, my mistake. It looks like it is quoting the path properly when you select it that file using the file dialog. Or at least it looks like it! Can you select the entire contents of the text that was added to the "Program" text field, copy it, paste it into a terminal window, and hit Return? Does it run? If not, what's the error message?
Text in the "Program" filed is '/home/igor/Markdown Tools/bin/md-editor' It launches from terminal without any problem.
Thank you, that's very helpful. I can reproduce the bug now with git master of KF6 too. The exact error message I see in the journal log is: > kf.kio.gui: "Could not find the program ''/home/nate/Markdown Tools/foo.sh''" Looks like some bad quoting, maybe? When I open the .desktop file that I constructed, I see the following: > Exec=''\\''/home/nate/Markdown Tools/foo.sh'\\''' If I remove the excess quotes and backslashes and change it to this: > Exec='/home/nate/Markdown Tools/foo.sh' Then it works. Méven, would you be able to take a look here?
Also Igor, note that you'll want to change your exec line in KMenuEdit to `/home/igor/Markdown Tools/bin/md-editor %F` to make it pass the file path of the file to `md-editor`. See https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s07.html.
Relevant: https://invent.kde.org/plasma/kmenuedit/-/commit/87c38a30fff27e3e9c0375f5c17d53ab0644ea0f https://invent.kde.org/plasma/kmenuedit/-/commit/6f9126f99f6b6ff8d041447740007ae49be2a5d6
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kmenuedit/-/merge_requests/27
Git commit 90ddeb9f2fd05529c4cda97502faa094adf7f9cc by Méven Car. Committed on 27/09/2023 at 12:02. Pushed by meven into branch 'master'. Better construct command line After 87c38a30fff27e3e9c0375f5c17d53ab0644ea0f the executable was KShell::joinArgs but it wasn't need. M +12 -5 basictab.cpp https://invent.kde.org/plasma/kmenuedit/-/commit/90ddeb9f2fd05529c4cda97502faa094adf7f9cc
Git commit 91133087ae39f05ac837f93cb4fcfcd32d3b8308 by Méven Car. Committed on 28/09/2023 at 14:55. Pushed by meven into branch 'Plasma/5.27'. Better construct command line After 87c38a30fff27e3e9c0375f5c17d53ab0644ea0f the executable was KShell::joinArgs but it wasn't need. (cherry picked from commit 90ddeb9f2fd05529c4cda97502faa094adf7f9cc) M +12 -5 basictab.cpp https://invent.kde.org/plasma/kmenuedit/-/commit/91133087ae39f05ac837f93cb4fcfcd32d3b8308