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

Investigate inheritEnv in VS Code #5

Open
eieioxyz opened this issue Jun 29, 2020 · 2 comments
Open

Investigate inheritEnv in VS Code #5

eieioxyz opened this issue Jun 29, 2020 · 2 comments

Comments

@eieioxyz
Copy link
Owner

eieioxyz commented Jun 29, 2020

Why are there duplicate paths in the terminal's $PATH environment variable and/or why are they reversed?

There are two direct fixes for this. You can set "terminal.integrated.inheritEnv": false

We've seen two mentions of removing some environment variables (also in the comment below).

...which will strip most environment variables from the terminal's environment, except for some important ones (like HOME, SHELL, TMPDIR, etc.).

image

eieioxyz added a commit that referenced this issue Jun 30, 2020
@eieioxyz
Copy link
Owner Author

Launch terminals with clean environments


The Integrated Terminal in VS Code has always acted a little differently to normal terminals, particularly on Linux and macOS.

Ok, good to know.


macOS: Pull a handful of important environment variables off the current environment and only include them. Eventually we would like macOS to behave the same as Linux but there are currently issues with fetching environments.

Apparently, $USER isn't an important environment variable. But there's a plan to fix it eventually.


The main visible result of setting inheritEnv to false is that $SHLVL (shell level) should now be 1 and $PATH should not include duplicate paths, provided your launch scripts don't intentionally include them.

Will this affect our new $SHLVL prompt section (4de328d)?


The default value for terminal.integrated.inheritEnv is true, which is the previous behavior, but we will probably switch the value to false in the future.

Eventually, it might be false and "just work."

@eieioxyz
Copy link
Owner Author

We really need to get VS Code settings like this in the repo: #13

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

1 participant