Change:
VSCode Version: 1.7.1 OS Version: Win 10 Pro Add an option to set environment variables before starting the terminal. Something like: Or maybe you want to split variable and value something like: Obviously the same goes for Linux and Mac
I'm curious what your use case is for wanting this in VS Code but not in Windows?
Here are some use cases (first two from personal experience): Different paths to libs per workbench Test your application with different languages/translations. It would also have made a much better work-around for You just don't want to set set the right vars every time you open a terminal.
! how should i fix this problem
If you are asking because I mentioned in my previous comment, I have no idea about that issue. That one is not my bug report. I just ran into that issue when I was searching around if the request I wanted to submit was not a dup.
Its not hard to see in the Python context an app needing a specific PYTHON_PATH, and other languages needing class paths/library paths. My thoughts here is that the tasks may be the workaround - a task can have associated env vars - and a make/rake/grunt/gulp/fabfile or something could be used to set it all up for your project.
I would love to see that too. For me it's about setting workspace env variables to be used with node gyp. Like OPENCV location
How does one configure this on the Insiders build?
It will be in the next build of Insiders, you will be able to use the new settings:
I can confirm that it works great for me, i now use it in almost all my projects Thanks!
UPDATE Again: Just found :man_facepalming: ! UPDATE: DOH! I just realized . God I love this editor! Amazing job. Is there any way to make this project specific? I am using this now for GOPATH but would love if it changed to the current working directory, which the integrated terminal seems to be aware of when it starts up. Maybe there is a variable I could set the envs to that contains the same value used by the starting terminal.
Anything in is already specific to the root folder that is open in VS Code. This is called the Workspace settings.
how to specify the GOPATH env variable inside the integrated terminal to be the same as the one inside your ? I am trying this on 1.17.1 and does not seem to work:
Thanks but in my case the following is what I'm after, but doesn't seem to be working. The use of the variable seems to work fine because it stops the underlined errors in code related to gopath, but the env var on the terminal still is bork. I'm mostly good because I also setup an install task that works. Now if I could only get that to like the libraries do correctly so things would compile automatically on changes (which I realize many would not like). ! By the way, here is an (old) task that works. But, it is interesting that everyone has different variable names for the same thing (workspaceFolder v.s. workspaceRoot): !
You are using in the env var for the which doesnt get resolved. Should we add resolution of such variables when using the setting? For vs see
Resolving variables in the setting is tracked in
After upgrading from 1.17 to 1.18, the setting doesn't work anymore (OS Version: OSX High Sierra) version 1.18: <img width="1064" alt="screen shot 2017-11-15 at 10 12 25" src="https://user-"version 1.17: <img width="442" alt="screen shot 2017-11-15 at 10 16 13" src="https://user-"
Just tried on my Mac, it works as expected. One thing to keep in mind is that the env vars will not affect terminals that were created before the env vars were to the setting. Can you create a new terminal and check there?
it was indeed on a new terminal after the env was . I've retried it on two high sierra machines recently.
I tried on a co-worker's high sierra machine. Works there as well. Can you try on our Insiders? Can you try with extensions disabled?

Discussion:
commandsToSkipShell: string[]; cwd: string; confirmOnExit: boolean; <ins> env: { linux: { [key: string]: string }; osx: { [key: string]: string }; windows: { [key: string]: string }; }; </ins> } export interface ITerminalConfigHelper {

DeleteWordLeftTerminalAction.ID, DeleteWordRightTerminalAction.ID ].sort() <ins> }, 'terminal.integrated.env.osx': { 'description': nls.localize('terminal.integrated.env.osx', "Object with environment variables that will be added to the VS Code process to be used by the terminal on OS X"), 'type': 'object', 'default': {} }, 'terminal.integrated.env.linux': { 'description': nls.localize('terminal.integrated.env.linux', "Object with environment variables that will be added to the VS Code process to be used by the terminal on Linux"), 'type': 'object', 'default': {} }, 'terminal.integrated.env.windows': { 'description': nls.localize('terminal.integrated.env.windows', "Object with environment variables that will be added to the VS Code process to be used by the terminal on Windows"), 'type': 'object', 'default': {} </ins> } } });

this._configHelper.mergeDefaultShellPathAndArgs(shell); } this._initialCwd = this._getCwd(this._shellLaunchConfig, this._historyService.getLastActiveWorkspaceRoot()); <del> const env = TerminalInstance.createTerminalEnv(process.env, shell, this._initialCwd, locale, this._cols, this._rows); </del> <ins> const platformKey = platform.isWindows ? 'windows' : platform.isMacintosh ? 'osx' : 'linux'; const envFromConfig = { ...process.env, ...this._configHelper.config.env[platformKey] }; const env = TerminalInstance.createTerminalEnv(envFromConfig, shell, this._initialCwd, locale, this._cols, this._rows); </ins> this._title = shell.name || ''; this._process = cp.fork(Uri.parse(require.toUrl('bootstrap')).fsPath, ['--type=terminal'], { env,