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

Failure to load LANG env var #16

Closed
Nokel81 opened this issue Jun 22, 2020 · 1 comment
Closed

Failure to load LANG env var #16

Nokel81 opened this issue Jun 22, 2020 · 1 comment

Comments

@Nokel81
Copy link

Nokel81 commented Jun 22, 2020

Description:
shell-env sometimes does not return all the environment variables that would be present after just starting a new terminal window.

System:

  • OS: macos 10.15.3

Related Issues:
lensapp/lens#492 and lensapp/lens#351

This issue (and PR) are to fix LANG not being loaded properly.

Specifics:
It seems that macos (in particular) looks for the LANG env var to figure out how to send data to an application when pasting text. Namely, if one copies a unicode character from a web browser (firefox is what I tested) and paste it into a text region in an electron application, then the raw bytes that presented (to the JS using Uint8Array) change if LANG=en_us.UTF-8 is subsequently added to the processes env collection.

@sindresorhus
Copy link
Owner

There's unfortunately not much I can do based on this information, since I cannot reproduce. A reproducible test case would go a long way. If you can reliably reproduce this on your machine, I would recommend trying to debug it a little bit. For example, try confirming that it detect the correct shell, and that running the shell normally with these commands:

shell-env/index.js

Lines 6 to 9 in a95fd44

const args = [
'-ilc',
'echo -n "_SHELL_ENV_DELIMITER_"; env; echo -n "_SHELL_ENV_DELIMITER_"; exit'
];
outputs the expected result.

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