SUMMARY Commands launched using any of the shortcuts does not inherit environment set using `dbus-update-activation-environment`. This is causing problems especially when using SSH agent, which sets `SSH_AUTH_SOCK` as part of launching `ssh-agent` using the script in `/usr/lib/openssh/agent-launch`. STEPS TO REPRODUCE 1. If Konsole is not present under `Applications` section, add Konsole application by clicking `Add New` > `Application...`. Then select `Konsole` and click `OK`. 2. Use the default key shortcut `Ctrl+Alt+T` or set the one of your choice. 3. Press `Apply` 4. Now hit the shortcut you selected in step 2. 5. In the terminal window, type the below command and press enter. ``` export|grep SSH ``` 6. The command will come back empty. 7. Close the window and make sure there are no other Konsole windows running. Alternatively, in the konsole window, type `killall konsole` and press enter. 8. Now launch Konsole from `Application Menu` or run it from KRunner (`Alt+F2`) 9. Try the same command as from step 5. 10. You will now see some output like below. ``` declare -x SSH_AGENT_LAUNCHER="openssh" declare -x SSH_AUTH_SOCK="/run/user/1000/openssh_agent" ``` OBSERVED RESULT When running Konsole via a global shortcut, no environment variables set from `dbus-update-activation-environment` are inherited. EXPECTED RESULT No matter how Konsole is run, it should inherit the environment set by `dbus-update-activation-environment`. SOFTWARE/OS VERSIONS Operating System: KDE neon 6.0 KDE Plasma Version: 6.0.3 KDE Frameworks Version: 6.0.0 Qt Version: 6.6.3 Kernel Version: 6.5.0-26-generic (64-bit) Graphics Platform: Wayland Processors: 8 × Intel® Core™ i7-10510U CPU @ 1.80GHz Memory: 15.3 GiB of RAM Graphics Processor: Mesa Intel® UHD Graphics ADDITIONAL INFORMATION
See https://bugs.kde.org/show_bug.cgi?id=483541 I don't see how dbus-update-activation-environment is related. It updates the environment for DBus activation, but Konsole is not launched through DBus (whether by shortcut or not) since it's not a DBus-Activatable app
Do pardon my ignorance. I am not that experienced with the technicality of launching apps on KDE / freedesktop system. Do educate me! How is it that Konsole gets the expected environment variables when it is launched using KRunner? Without fixing this, I can't see how Konsole and any scripts launched from within it can get SSH_AUTH_SOCK. I tried setting the variable up in `$HOME/.config/plasma-workspace/env/ssh-agent-sock.sh`, but that actually prevents the `agent-launch` from working correctly, since the launch script checks for the variable to be empty. I do have a workaround; just setting it in `.bashrc`, since the systemd service does not use temporary / randomised naming for the socket path. I would rather have it working without. My worry is that a beginner would struggle to figure out...
(In reply to Nicolas Fella from comment #1) > See https://bugs.kde.org/show_bug.cgi?id=483541 > > I don't see how dbus-update-activation-environment is related. It updates > the environment for DBus activation, but Konsole is not launched through > DBus (whether by shortcut or not) since it's not a DBus-Activatable app Pretty clear from the linked bug as to why its not working. I really hope a solution can be found for KDE Neon!