Skip to content

This extension interferes with terminals including those for other extensions #8241

Description

@DavidKMaslen

When this extension is installed it causes the command C:/ProgramData/Anaconda and then "conda activate base" to be run in terminal windows, including in REPL windows for other languages. This causes errors before the Python REPL starts.

The interesting thing is that enabling this extension causes the same behavior for other terminals and extensions in VS Code even when they have nothing to do with Python. So all shells start with these two commands whether they make sense or not. Also the first two lines of the Julia REPL are those two lines -- which obviously make no sense as Julia statements.

Turning off the vscode-python extension fixes the problem, but that's a pity.

I'll also note here that when the a Python REPL is started the name given to it is "REPL" which is a bit non-specific as there are other languages that have REPLs. "Python" would be a better name.

Environment data

  • VS Code version: 1.39.2
  • Extension version (available under the Extensions sidebar): 2019.10.44104
  • OS and version: Windows 7
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda Python 3.6.4
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): None
  • Relevant/affected Python packages and their versions:
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info How to update the language server to the latest stable version #3977): XXX

Expected behaviour

Starting a terminal or REPL unrelated to python should not cause conda start-up commands to run.

Actual behaviour

Opening any new terminal, including a shell or a Julia REPL causes the conda start up commands to run in that shell or REPL, regardless of whether these make sense or can be run. Here is what I see when opening a command shell terminal example:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Data\Projects\repos\home-dev>C:/ProgramData/Anaconda3/Scripts/activate

(base) C:\Data\Projects\repos\home-dev>conda activate base

(base) C:\Data\Projects\repos\home-dev>

And here is what I see when running Julia: Start REPL

julia> C:/ProgramData/Anaconda3/Scripts/activate
ERROR: syntax: "/" is not a unary operator

julia> conda activate base
ERROR: syntax: extra token "activate" after end of expression

julia>

Steps to reproduce:

  1. Install an Anaconda distribution
  2. Install the extension
  3. Set the python interpreter for VS Code to point to the Anaconda python.
  4. Open a terminal using New Terminal under the Terminal menu.

Disabling the python extension solves the problem and sets the behavior to normal.

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)


Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions