Skip to content

Incorrect file is sourced when terminal activates virtual env #7111

Closed
@thernstig

Description

@thernstig

Environment data

  • VS Code version: 1.38.0-insider (user setup)
  • Extension version (available under the Extensions sidebar): 2019.8.30787
  • OS and version: Ubuntu 16.04
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.9
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): Pipenv
  • Relevant/affected Python packages and their versions: XXX
  • 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): language server

Expected behaviour

Welcome to fish, the friendly interactive shell
$ source /home/username/projectA/.venv/bin/activate.fish
$

Actual behaviour

Welcome to fish, the friendly interactive shell
$ source /home/username/projectA/.venv/bin/activate
~/projectA/.venv/bin/activate (line 82): Missing end to balance this if statement
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
^
from sourcing file ~/projectA/.venv/bin/activate
        called on standard input

source: Error while reading file “/home/username/projectA/.venv/bin/activate”
$ 

Steps to reproduce:

  1. This happens intermittently and not every time a new terminal is started. Just start a new terminal and "hope" the problem happens. For some reason it sometimes do not source the .fish specific venv activation file. I think this only sometimes happen when you open a new terminal after VS Code has been opened. Closing & re-opening the terminal multiple times does not seem to trigger the fault.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from poster

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions