| 25 Nov 2022 |
K900 | And of course it shoves it in a thread local | 17:23:42 |
psvo | the locale is not UTF8 | 17:23:43 |
K900 | I'm guessing touching any of the LC_ variables will make it reload the locale from disk | 17:24:03 |
K900 | Thus defeating the point | 17:24:07 |
psvo | Well, you can break it even later:
CZsvobodpe02% export LC_ALL=C
CZsvobodpe02% echo '\u00a0'
zsh: character not in range
| 17:25:11 |
K900 | Yeah but that's explicitly setting a non-UTF8 locale | 17:25:24 |
K900 | Oh | 17:27:12 |
K900 | I got it | 17:27:16 |
K900 | I think | 17:27:24 |
K900 | It looks like it's just shoved into the global systemd environment by default | 17:27:36 |
K900 | But somehow that doesn't happen for WSL | 17:28:29 |
K900 | And I think it might be because we're spawning it wrong maybe? | 17:29:43 |
K900 | If this is the fix I am going to mcfuckingloseit | 17:32:18 |
psvo | I'm not sure I follow - I don't have locale-related env vars in /proc/1/environ | 17:32:36 |
K900 | EXACTLY | 17:34:38 |
psvo | hm, for consideration: I've just switched my default locale cs_CZ.UTF8, but the shell spawned by WSL /init is still having LANG=en_US.UTF-8 | 17:38:08 |
K900 | Oh no | 17:38:19 |
K900 | I think it's worse actually | 17:38:22 |
K900 | LOCALE_ARCHIVE is normally set by PAM | 17:38:27 |
K900 | But we don't have a PAM | 17:38:29 |
psvo | hm, seems the env is correct only for the bash spawn by the /bin/login, so I believe you are right | 17:40:43 |
K900 | I wonder if it'll work if i set the environment on the systemd itself | 17:42:14 |
K900 | Since technically the /init process is its child | 17:43:16 |
psvo | it seem the locale is by /init | 17:44:05 |
K900 | Worst case, we can generate a horrible wrapper script to export environment.sessionVariables and then exec into the normal shell | 17:44:11 |
psvo | * it seem the locale is set by /init | 17:44:13 |
K900 | Oh actually I don't think we can | 17:48:34 |
K900 | That's fun | 17:48:35 |
K900 | Because we have to do it for every user and NixOS modules don't like this kind of recursion | 17:48:48 |
psvo | btw: https://learn.microsoft.com/en-us/windows/wsl/faq#how-do-i-change-the-display-language-of-wsl- | 17:51:14 |