This has been reported downstream here: https://bugzilla.opensuse.org/show_bug.cgi?id=1154345 https://lists.opensuse.org/opensuse-factory/2019-10/msg00137.html If the environment contains exported shell functions, the new startplasma applications break them, resulting in error messages when opening a shell in the Plasma session (as a side-effect, that also breaks kdesu). To reproduce, make sure ~/.config/plasma-locale-settings.sh exists (some script in ~/.config/plasma-workspace/env/ will probably do as well), and add something like this to ~/.bashrc, ~/.profile or similar: -------------------- function sayhello { echo 'Hello!' } export -f sayhello -------------------- Then logout/login to Plasma. If you open Konsole, you'll get this error now: bash: sayhello: line 1: syntax error: unexpected end of file bash: error importing function definition for `sayhello' Running "env" (or plasma-sourceenv.sh) inside a Plasma session gives this output: ... BASH_FUNC_sayhello%%=() { echo 'Hello!' ... Correct would be: ... BASH_FUNC_sayhello%%=() { echo 'Hello!' } ... (this is what I get when running "env" in a non-Plasma session)
Might be possible to fix by running plasma-sourceenv.sh with an empty environment and avoiding to read /etc/profile. I'll give it a try.
Setting impact to critical as this breaks a ton of applications and scripts.
(In reply to Fabian Vogt from comment #1) > Might be possible to fix by running plasma-sourceenv.sh with an empty > environment and avoiding to read /etc/profile. I'll give it a try. Actually, that might break some scripts which rely on (WAYLAND_)DISPLAY, XDG_RUNTIME_DIR or similar. It should be sufficient to print the variables in a better format, like delimited by \0.
Git commit 595ab88bc2ee0ed32da577ec8ae22efee90865b5 by Fabian Vogt. Committed on 18/10/2019 at 12:38. Pushed by fvogt into branch 'Plasma/5.17'. Fix reading environment variables with newline Summary: Use '\0' as separator as '\n' is likely to appear in values. Test Plan: /etc/profile.d/mc.sh exported an mc() function, which resulted in "syntax error: unexpected end of file" in the Plasma session. Now the mc function is correctly set in the environment. Reviewers: #plasma, apol, davidedmundson, adridg Reviewed By: #plasma, apol, davidedmundson, adridg Subscribers: davidedmundson, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D24750 M +1 -1 startkde/plasma-sourceenv.sh M +1 -1 startkde/startplasma.cpp https://commits.kde.org/plasma-workspace/595ab88bc2ee0ed32da577ec8ae22efee90865b5