STEPS TO REPRODUCE 1. Change the Exec line in the Thunderbird desktop file to "MOZ_ENABLE_WAYLAND=1 /usr/lib/thunderbird/thunderbird %u" 2. Set thunderbird as default email client 3. Create and start a KEmailClientLauncherJob OBSERVED RESULT Thunderbird does not open kf.kio.gui: Failed to register new cgroup: "app--a2814818d4114405bc37e453a8dc3eaf.scope" "org.freedesktop.DBus.Error.UnixProcessIdUnknown" "Process with ID 125248 does not exist." This is because KIO::DesktopExecParser::executableName trips over the env variable Removing the env variable makes it work EXPECTED RESULT Thunderbird opens SOFTWARE/OS VERSIONS KDE Plasma Version: master KDE Frameworks Version: master Qt Version: 5.15-kde
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/751
Git commit 4c4f4b919a81706913596e7ba518165dd80c9eb7 by Ahmad Samir. Committed on 23/02/2022 at 11:44. Pushed by ahmadsamir into branch 'master'. DesktopExecParser: parse environment variables too And add a method that returns a QProcessEnvironment object containing those environment variables (thanks to Meven for the idea of returning a QPE). Add unittest. FIXED_IN: 5.92 M +33 -0 autotests/krununittest.cpp M +2 -0 autotests/krununittest.h M +36 -1 src/core/desktopexecparser.cpp M +28 -3 src/core/desktopexecparser.h https://invent.kde.org/frameworks/kio/commit/4c4f4b919a81706913596e7ba518165dd80c9eb7
I don't think specifying environment variables like this is valid. The Exec= line must start with the application and must not contain '=': https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s07.html A command line consists of an executable program optionally followed by one or more arguments. The executable program can either be specified with its full path or with the name of the executable only. If no full path is provided the executable is looked up in the $PATH environment variable used by the desktop environment. The name or path of the executable program may not contain the equal sign ("="). Arguments are separated by a space. So the previous KIO behaviour was probably correct and the change should be reverted.
The thing is, launching the app works perfectly fine and sets the env variable, it's just that executableName behaves differently
(In reply to Nicolas Fella from comment #4) > The thing is, launching the app works perfectly fine and sets the env > variable, it's just that executableName behaves differently I'd say that's a bug - KIO should not accept it at all as it's invalid. That can cause weird issues and hide compatibility problems. I wonder how it works at all, it probably ends up in a /bin/sh context at some point.
Yes this ends up in /bin/sh. I thought any shell command was valid for an Exec line. Thanks for the pointer to the spec, that's instructive. Sometimes we voluntarily support more things than the spec, but it's probably not a great idea (creates compat problems when people test something in KDE and assume it'll work everywhere) I just found desktop files that say Exec=env WINEPREFIX="/home/dfaure/.wine" wine start /ProgIDOpen giffile %f Isn't this a solution to this problem? I.e. change step 1 to prepend "env" before the env var?
FTR, the commit was reverted. The solution David posted works?
Ping.
yes, env FOO=bar works
Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please mark the bug as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone!
This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging Thank you for helping us make KDE software even better for everyone!