Skip to content
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

Flex Launcher modifies locale environment variables for launched applications #31

Open
gregflynn opened this issue Mar 18, 2023 · 2 comments

Comments

@gregflynn
Copy link

So I have a terminal launched from Flex Launcher for debugging and I kept getting errors from perl on launch about improper locale settings, namely LANG=en

I'm on Arch and it's a fresh install, en_US.UTF-8

>>> cat /etc/locale.conf
LANG=en_US.UTF-8

If I re-source that locale conf or just export LANG=en_US.UTF-8 the problem is resolved for that terminal session.

If I SSH into the machine or launch the terminal using rofi, the LANG environment variable is properly set to en_US.UTF-8

I'm not sure how this issue would present in other applications but figured this was an unintentional bug that should be reported

@complexlogic
Copy link
Owner

Flex Launcher doesn't modify the LANG environment variable. It could be SDL, but I doubt it.

I suspect that the environment variables are not being transferred to the new child process. Currently the POSIX function execvp is used to execute the child processes. execve may be a better choice because it allows the caller to specify an array of environment variables. I can look into this later to confirm whether or not this is the cause of the issue.

@gregflynn
Copy link
Author

There's execvpe that has all the flags too. I thiiiink you always want to inherit the environment variables. What a mystery what's causing the change.

I'm working around this in a pythong script (the script is for autoswitching resolution between apps and flex-launcher):

env = dict(os.environ)
env["LANG"] = "en_US.UTF-8"
subprocess.run(cmd, shell=True, env=env)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants