Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminal activate conda base environment just after activating the right environment #147016

Closed
Lawiss opened this issue Apr 7, 2022 · 9 comments
Assignees

Comments

@Lawiss
Copy link

Lawiss commented Apr 7, 2022

Does this issue occur when all extensions are disabled?: Yes/No

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.9.9
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Conda
  • Value of the python.languageServer setting: Default
User Settings


defaultLS: {"defaultLSType":"Pylance"}

downloadLanguageServer: true

envFile: "<placeholder>"

venvPath: "<placeholder>"

venvFolders: "<placeholder>"

condaPath: "<placeholder>"

pipenvPath: "<placeholder>"

poetryPath: "<placeholder>"

languageServer: "Pylance"

linting
• enabled: true
• cwd: "<placeholder>"
• Flake8Args: "<placeholder>"
• flake8Enabled: false
• flake8Path: "<placeholder>"
• lintOnSave: true
• banditArgs: "<placeholder>"
• banditEnabled: false
• banditPath: "<placeholder>"
• mypyArgs: "<placeholder>"
• mypyEnabled: false
• mypyPath: "<placeholder>"
• pycodestyleArgs: "<placeholder>"
• pycodestyleEnabled: false
• pycodestylePath: "<placeholder>"
• prospectorArgs: "<placeholder>"
• prospectorEnabled: false
• prospectorPath: "<placeholder>"
• pydocstyleArgs: "<placeholder>"
• pydocstyleEnabled: false
• pydocstylePath: "<placeholder>"
• pylamaArgs: "<placeholder>"
• pylamaEnabled: false
• pylamaPath: "<placeholder>"
• pylintArgs: "<placeholder>"
• pylintPath: "<placeholder>"

sortImports
• args: "<placeholder>"
• path: "<placeholder>"

formatting
• autopep8Args: "<placeholder>"
• autopep8Path: "<placeholder>"
• provider: "black"
• blackArgs: "<placeholder>"
• blackPath: "<placeholder>"
• yapfArgs: "<placeholder>"
• yapfPath: "<placeholder>"

testing
• cwd: "<placeholder>"
• debugPort: 3000
• nosetestArgs: "<placeholder>"
• nosetestsEnabled: undefined
• nosetestPath: "<placeholder>"
• promptToConfigure: true
• pytestArgs: "<placeholder>"
• pytestEnabled: false
• pytestPath: "<placeholder>"
• unittestArgs: "<placeholder>"
• unittestEnabled: false
• autoTestDiscoverOnSaveEnabled: true

terminal
• activateEnvironment: true
• executeInFileDir: "<placeholder>"
• launchArgs: "<placeholder>"

experiments
• enabled: true
• optInto: []
• optOutFrom: []

tensorBoard
• logDirectory: "<placeholder>"

Extension version: 2022.4.0
VS Code version: Code 1.66.0 (Universal) (e18005f, 2022-03-30T05:50:04.419Z)
OS version: Darwin arm64 21.4.0
Restricted Mode: No

System Info
Item Value
CPUs Apple M1 Pro (8 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 5, 5, 5
Memory (System) 16.00GB (0.08GB free)
Process Argv --crash-reporter-id a129d0b2-ecd6-4f0a-8ff3-d67e5b6507fa
Screen Reader yes
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392:30443607
pythontb:30283811
pythonvspyt551cf:30345471
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscoreces:30445986
pythondataviewer:30285071
vscod805cf:30301675
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
testflight:30433670
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
pythonvsnew555:30457759
vscscmwlcmt:30465135
cppdebug:30466689
pynewfile477:30463512

Behaviour

Expected vs. Actual

Hello,
When I select my conda env for the workspace, I expect that each terminal session activate this environment. In the past it worked well. But since a few days I have a strange behaviour : the terminal execute the command conda activate myenv then just after source /Users/luis/miniforge3/bin/activate reactivating base env. (see in screenshoot)

Steps to reproduce:

Enregistrement de l’écran 2022-04-06 à 12 03 22(1)

@meganrogge
Copy link
Contributor

@karthiknadig any thoughts?

@karthiknadig
Copy link
Member

@meganrogge This was filed here in response to this comment: microsoft/vscode-python#18868 (comment)

Even though python extension is sending the commands in the order:

source /Users/luis/miniforge3/bin/activate
conda activate velov

The second command is executed first.

/cc @karrtikr

@meganrogge
Copy link
Contributor

Thanks, how are those currently being sent ? Via send text to terminal? @karthiknadig

@karrtikr
Copy link
Contributor

karrtikr commented Apr 8, 2022

@meganrogge meganrogge added bug Issue identified by VS Code Team member as probable bug confirmation-pending terminal-process Problems launching processes, managing ptys, exiting, process leaks, etc. labels Apr 13, 2022
@meganrogge
Copy link
Contributor

meganrogge commented May 2, 2022

@karrtikr The gif above shows that the commands are being echoed by the pty in the correct order. What the shell (zsh) does with those after is not something we can control.

If we had this API, you could more reliably know when a command is finished
#145234

@meganrogge meganrogge removed bug Issue identified by VS Code Team member as probable bug confirmation-pending terminal-process Problems launching processes, managing ptys, exiting, process leaks, etc. labels May 2, 2022
@karrtikr
Copy link
Contributor

karrtikr commented May 2, 2022

I assume this means that this is a bug with zsh shell itself. Can you provide the steps to simulate sending commands outside of VSCode? Ideally this should be reported there before it's closed.

@meganrogge
Copy link
Contributor

Does the issue reproduce in bash?

@karrtikr
Copy link
Contributor

karrtikr commented May 2, 2022

For me it doesn't, also we only received issues for ZSH.

@Lawiss Can you confirm if using bash has the same issue?

@Lawiss
Copy link
Author

Lawiss commented May 3, 2022

Hello @karrtikr @meganrogge,

Indeed, I can reproduce the issue only on zsh, commandes are fired in the correct order on bash.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants