sddm icon indicating copy to clipboard operation
sddm copied to clipboard

readonly export + Fish combination

Open gitfib opened this issue 4 years ago • 4 comments

I'm posting here to continue the conversation from #1331 In openSUSE Tumbleweed, /etc/profile has a readonly export, PROFILEREAD #1331 adds sourcing of /etc/profile and ~/.profile for Fish in both Xorg and Wayland. Due to the way it's implemented, the variables are being sourced twice, both times include the readonly variable I'm not getting the issue in Xorg because a different script is being used (/usr/etc/X11/xdm/Xsession) It can be reproduced by running:

fish$ sh # which is a symlink to bash
sh$ . /etc/profile
sh$ . <(export -p)

Here are some ideas on how to handle this:

  1. Do nothing, and expect distro and system maintainers to patch it accordingly. Is it safe to assume that a readonly variable will not be exported by a third party program in /etc/profile.d/?
  2. Use diff so the second sourcing will only include changed variables
  3. Use declare -px instead of export -p, causing the readonly export to become writable, which can't be a good idea I tried to grep the results of declare -p instead, but I went into an issue where PROFILEREAD was still -x instead of -rx

In the meantime, openSUSE Fish users can add export -n PROFILEREAD to ~/.profile

gitfib avatar Apr 12 '21 17:04 gitfib

In the meantime, openSUSE Fish users can add export -n PROFILEREAD to ~/.profile

😍 Last 2 times I've updated my openSUSE I couldn't start wayland session and have pain figuring out why (I update my old laptop once or twice a year). Thanks for posting the workaround which doesn't involve changing system files. 🙇‍♂️

ytimenkov avatar Jul 22 '21 16:07 ytimenkov

The problem has now reached other users as well, e.g. the Opensuse Leap users using the additional KDE repositories and other shells (as the previous mentions show). So I guess that option 1) (do nothing) is not a good thing. Which leaves option 2) (diff) or a different solution.

Thanks for the workaround for fish, it works for me!

bernhardreiter avatar Mar 25 '24 16:03 bernhardreiter

https://github.com/sddm/sddm/pull/1779 fixes this.

Vogtinator avatar Mar 25 '24 17:03 Vogtinator

I can confirm this patch worked for me on NixOS.

anthr76 avatar Mar 26 '24 10:03 anthr76