title: Why is VS Code calling the wrong virtual environment as base?
body: <p>I have some conda virtual environments in a server I SSH into in a daily basis. Logging in from the terminal and listing the environments gives me the following:</p>
  <pre><code>(base) [rgr6291@klc0201 ~]$ conda env list
  # conda environments:
  #
  fomc                     /home/rgr6291/.conda/envs/fomc
  r_conda                  /home/rgr6291/.conda/envs/r_conda
  rfe_paper                /home/rgr6291/.conda/envs/rfe_paper
  base                  *  /software/python-anaconda3/2019.10
  </code></pre>
  <p>So I have base and three virtual environments. I usually edit code on the server using Visual Studio Code and the Remote SSH extension. VS Code recognizes all these environments when I am prompted to select the Python interpreter:</p>
  <p><a href="https://i.stack.imgur.com/FqOMI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FqOMI.png" alt="enter image description here" /></a></p>
  <p>It turns out that starting a terminal window <em>from</em> VS Code leads to different behavior whether I am on the <code>fomc</code> environment or not.</p>
  <p>If I select, say, the <code>rfe_paper</code> environment and start a new terminal from withing VS Code, I get the following automatic output:</p>
  <pre><code>source activate rfe_paper
  (base) [rgr6291@klc0201 HF_FOMC]$ source activate rfe_paper
  (rfe_paper) [rgr6291@klc0201 HF_FOMC]$ 
  </code></pre>
  <p>It starts up the terminal and then activates the desired environment. However, the same procedure from the <code>fomc</code> environment leads to something different:</p>
  <pre><code>source /home/rgr6291/.conda/envs/fomc/bin/activate
  (base) [rgr6291@klc0201 HF_FOMC]$ source /home/rgr6291/.conda/envs/fomc/bin/activate
  (base) [rgr6291@klc0201 HF_FOMC]$ conda activate fomc
  
  (base) [rgr6291@klc0201 HF_FOMC]$ conda env list
  # conda environments:
  #
  base                  *  /home/rgr6291/.conda/envs/fomc
  r_conda                  /home/rgr6291/.conda/envs/r_conda
  rfe_paper                /home/rgr6291/.conda/envs/rfe_paper
  </code></pre>
  <p>Notice that there is an extra <code>source</code> call in the beginning. And somehow VS Code is misled and believes the <code>fomc</code> environment is the base one.</p>
  <ol>
  <li>What might be causing this?</li>
  <li>How to fix this?</li>
  </ol>
  <p>It was working fine yesterday but it seems broken today. The only difference is that I exported the installed packages in <code>fomc</code> to an yml file this morning. I don't know how that would affect behavior.</p>
  <p>By the way, let me report the following as well. This is the content of <code>~/.conda/envs/fomc/bin/activate</code>:</p>
  <pre><code>#!/bin/sh
  _CONDA_ROOT=&quot;/home/rgr6291/.conda/envs/fomc&quot;
  # Copyright (C) 2012 Anaconda, Inc
  # SPDX-License-Identifier: BSD-3-Clause
  \. &quot;$_CONDA_ROOT/etc/profile.d/conda.sh&quot; || return $?
  conda activate &quot;$@&quot;
  </code></pre>
  <p>I think CONDA_ROOT is wrong, but I have no idea of what it should actually be.</p>
  <p>Thanks in advance.</p>