-
Notifications
You must be signed in to change notification settings - Fork 236
pkg/utils: Preserve environment variables set by a KDE session and Konsole #1698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkg/utils: Preserve environment variables set by a KDE session and Konsole #1698
Conversation
A KDE session sets some environment variables to influence the behaviour of various programs and to access various settings [1]. eg., if the KDE_SESSION_VERSION environment variable is absent then applications won't respect KDE's theme or display scaling settings. These environment variables are not meant to be set by the shell's start-up scripts, but directly by KDE, and hence needs to be preserved across the host operating system and Toolbx container. [1] https://userbase.kde.org/KDE_System_Administration/Environment_Variables containers#1696 containers#1698
e7e040d
to
610b291
Compare
Build failed. ✔️ unit-test SUCCESS in 2m 13s |
A KDE session sets some environment variables to influence the behaviour of various programs and to access various settings [1]. eg., if the KDE_SESSION_VERSION environment variable is absent then applications won't respect KDE's theme or display scaling settings. These environment variables are not meant to be set by the shell's start-up scripts, but directly by KDE, and hence needs to be preserved across the host operating system and Toolbx container. [1] https://userbase.kde.org/KDE_System_Administration/Environment_Variables containers#1696 containers#1698
610b291
to
6ef02da
Compare
The error is the same as we have seen recently on Fedora Rawhide:
It seems unrelated, and is probably due to some change in Fedora Rawhide. |
Build failed. ✔️ unit-test SUCCESS in 2m 15s |
Konsole injects the name of the current profile, and the identifiers of the current tab and window into the process running inside it through the KONSOLE_PROFILE_NAME, KONSOLE_DBUS_SESSION and KONSOLE_DBUS_WINDOW environment variables respectively [1,2,3]. These are used by programs like Neovim to detect the terminal features supported by Konsole [4,5], or by users to save the shell's history separately for each profile, tab or window [6]. These environment variables are not meant to be set by the shell's start-up scripts, but directly by Konsole, and hence needs to be preserved across the host operating system and Toolbx container. Note that KONSOLE_PROFILE_NAME was later removed from Konsole [7]. However, Neovim still uses it, so it's better to preserve it. [1] Konsole commit debfec2eb3c8ede8 https://invent.kde.org/utilities/konsole/-/commit/debfec2eb3c8ede8 https://bugs.kde.org/show_bug.cgi?id=227296 [2] Konsole commit fcd815256c3729f2 https://invent.kde.org/utilities/konsole/-/commit/fcd815256c3729f2 [3] Konsole commit 07cddfe302233c35 https://invent.kde.org/utilities/konsole/-/commit/07cddfe302233c35 https://bugs.kde.org/show_bug.cgi?id=276912 https://bugs.kde.org/show_bug.cgi?id=281513 https://bugs.kde.org/show_bug.cgi?id=292309 [4] Neovim commit 5fc4c2d442f01ab5 neovim/neovim@5fc4c2d442f01ab5 neovim/neovim#3129 [5] Neovim commit 3ccd59ee8216f3da neovim/neovim@3ccd59ee8216f3da neovim/neovim#6432 neovim/neovim#6429 neovim/neovim#6430 [6] https://userbase.kde.org/Konsole/en [7] Konsole commit 9e3a30fdca2078e0 https://invent.kde.org/utilities/konsole/-/commit/9e3a30fdca2078e0 https://bugs.kde.org/show_bug.cgi?id=406955 containers#1449 containers#1696 containers#1698
Build failed. ✔️ unit-test SUCCESS in 2m 09s |
Detected by https://www.shellcheck.net/: Line 1255: if ! localtime_target=$(readlink /etc/localtime >/dev/null 2>&3) \ ^-- SC2327 (warning): This command substitution will be empty because the command's output gets redirected away. ^-- SC2328 (error): This redirection takes output away from the command substitution. See: https://www.shellcheck.net/wiki/SC2327 https://www.shellcheck.net/wiki/SC2328 Fallout from 8db414d containers#1701
Bash 5.3.0 changed the error messages shown by its exec built-in [1]. With Bash 5.2.37: $ exec /etc bash: /etc: Is a directory bash: exec: /etc: cannot execute: Is a directory With Bash 5.3.0: $ exec /etc bash: /etc: Is a directory The 'assert' function cannot directly handle compound commands. So, those need to be wrapped in 'bash -c "..."' [2]. [1] Bash commit b8c60bc9ca365f82 See how exec_builtin() handles EX_NOEXEC and EISDIR from shell_execve() to avoid printing a duplicate error message. https://cgit.git.savannah.gnu.org/cgit/bash.git/commit/?id=b8c60bc9ca365f82 [2] https://github.com/bats-core/bats-assert containers#1688 containers#1699
A KDE session sets some environment variables to influence the behaviour of various programs and to access various settings [1]. eg., if the KDE_SESSION_VERSION environment variable is absent then applications won't respect KDE's theme or display scaling settings. These environment variables are not meant to be set by the shell's start-up scripts, but directly by KDE, and hence needs to be preserved across the host operating system and Toolbx container. [1] https://userbase.kde.org/KDE_System_Administration/Environment_Variables containers#1696 containers#1698
Konsole injects the name of the current profile, and the identifiers of the current tab and window into the process running inside it through the KONSOLE_PROFILE_NAME, KONSOLE_DBUS_SESSION and KONSOLE_DBUS_WINDOW environment variables respectively [1,2,3]. These are used by programs like Neovim to detect the terminal features supported by Konsole [4,5], or by users to save the shell's history separately for each profile, tab or window [6]. These environment variables are not meant to be set by the shell's start-up scripts, but directly by Konsole, and hence needs to be preserved across the host operating system and Toolbx container. Note that KONSOLE_PROFILE_NAME was later removed from Konsole [7]. However, Neovim still uses it, so it's better to preserve it. [1] Konsole commit debfec2eb3c8ede8 https://invent.kde.org/utilities/konsole/-/commit/debfec2eb3c8ede8 https://bugs.kde.org/show_bug.cgi?id=227296 [2] Konsole commit fcd815256c3729f2 https://invent.kde.org/utilities/konsole/-/commit/fcd815256c3729f2 [3] Konsole commit 07cddfe302233c35 https://invent.kde.org/utilities/konsole/-/commit/07cddfe302233c35 https://bugs.kde.org/show_bug.cgi?id=276912 https://bugs.kde.org/show_bug.cgi?id=281513 https://bugs.kde.org/show_bug.cgi?id=292309 [4] Neovim commit 5fc4c2d442f01ab5 neovim/neovim@5fc4c2d442f01ab5 neovim/neovim#3129 [5] Neovim commit 3ccd59ee8216f3da neovim/neovim@3ccd59ee8216f3da neovim/neovim#6432 neovim/neovim#6429 neovim/neovim#6430 [6] https://userbase.kde.org/Konsole/en [7] Konsole commit 9e3a30fdca2078e0 https://invent.kde.org/utilities/konsole/-/commit/9e3a30fdca2078e0 https://bugs.kde.org/show_bug.cgi?id=406955 containers#1449 containers#1696 containers#1698
157d7d6
to
1f12775
Compare
Build failed. ✔️ unit-test SUCCESS in 2m 34s |
recheck |
Build succeeded. ✔️ unit-test SUCCESS in 2m 10s |
Build succeeded. ✔️ unit-test SUCCESS in 2m 04s |
See the individual commits for details.
#1449
#1696