<ul dir="auto">
<li>VSCode Version: 0.10.11</li>
<li>OS Version: Ubuntu 14.04</li>
</ul>
<p dir="auto">Steps to Reproduce:</p>
<ol dir="auto">
<li>
<p dir="auto">Export a variable in your default shell  (<code class="notranslate">~/.zlogin</code> for zsh;  <code class="notranslate">~/.bash_login</code> for bash, for example. You can use <code class="notranslate">.bashrc</code> as well).</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export FOOBAR=&quot;1&quot;"><pre class="notranslate"><span class="pl-k">export</span> FOOBAR=<span class="pl-s"><span class="pl-pds">"</span>1<span class="pl-pds">"</span></span></pre></div>
</li>
<li>
<p dir="auto">Pass different value of the same variable to VSCode.</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="FOOBAR=2 code ."><pre class="notranslate">FOOBAR=2 code <span class="pl-c1">.</span></pre></div>
</li>
<li>
<p dir="auto">VSCode uses value defined for login shell, not current session:</p>
</li>
</ol>
<p dir="auto">Help &gt; Toggle Developer Tools. And in Console,  <code class="notranslate">process.env.FOOBAR</code>  gives "1"  when I expect "2".</p>
<p dir="auto">It looks like VSCode executes default shell as login shell again before launching the program UI.</p>
<p dir="auto">Being able to pass different values for existing environment variables greatly helps writing/testing extensions.</p>
<p dir="auto">Related discussion:  <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="138329367" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode-go/issues/220" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode-go/issues/220/hovercard?comment_id=203092824&amp;comment_type=issue_comment" href="https://github.com/microsoft/vscode-go/issues/220#issuecomment-203092824">microsoft/vscode-go#220 (comment)</a></p>
<h6 dir="auto">strace example:</h6>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ strace -E GOPATH=1 -E FOOBAR=2 -s 1000000 -e verbose=execve -e abbrev=none ./.build/electron/electron  .
execve(&quot;./.build/electron/electron&quot;, [&quot;./.build/electron/electron&quot;, &quot;.&quot;], [... &quot;GOPATH=1&quot;, ...]) # What I expected
...
read(62, &quot;...\nGOPATH=/home/saml/go\n....&quot;)  # What is this?
..."><pre class="notranslate">$ strace -E GOPATH=1 -E FOOBAR=2 -s 1000000 -e verbose=execve -e abbrev=none ./.build/electron/electron  <span class="pl-c1">.</span>
execve(<span class="pl-s"><span class="pl-pds">"</span>./.build/electron/electron<span class="pl-pds">"</span></span>, [<span class="pl-s"><span class="pl-pds">"</span>./.build/electron/electron<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>.<span class="pl-pds">"</span></span>], [... <span class="pl-s"><span class="pl-pds">"</span>GOPATH=1<span class="pl-pds">"</span></span>, ...]) <span class="pl-c"><span class="pl-c">#</span> What I expected</span>
...
read(62, <span class="pl-s"><span class="pl-pds">"</span>...\nGOPATH=/home/saml/go\n....<span class="pl-pds">"</span></span>)  <span class="pl-c"><span class="pl-c">#</span> What is this?</span>
...</pre></div>
<p dir="auto">Per <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="120116257" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode-go/issues/141" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode-go/issues/141/hovercard" href="https://github.com/microsoft/vscode-go/issues/141">microsoft/vscode-go#141</a>, there appears to still be an issue with how env vars are passed into Code, even after the fix for <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="118682489" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/560" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/560/hovercard" href="https://github.com/microsoft/vscode/issues/560">#560</a>.</p>
<p dir="auto">Steps to reproduce:</p>
<ol dir="auto">
<li>have <code class="notranslate">export FOO=1</code> in your <code class="notranslate">.bash_profile</code></li>
<li>ensure your function to start visual studio code looks like this <code class="notranslate">code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;}</code></li>
<li>open a terminal session</li>
<li><code class="notranslate">export FOO=2</code> in your terminal session</li>
<li>open <code class="notranslate">code .</code></li>
<li>open developer tools, and eval <code class="notranslate">process.env["FOO"]</code></li>
</ol>
<p dir="auto">Expected: <code class="notranslate">Foo</code> should be <code class="notranslate">2</code><br>
Result: <code class="notranslate">FOO</code> will be <code class="notranslate">1</code></p>
<p dir="auto">But the thing that's really odd is that if you skip step (1) (remove this from you <code class="notranslate">.bash_profile</code>), you will see <code class="notranslate">Foo</code> set to <code class="notranslate">2</code>.  So in that case, the local environment is getting passed in.</p>
<p dir="auto">It seems like this must be either a problem with how vscode is setting up the env vars, or how <code class="notranslate">open</code> in OS X behaves.</p>