Repository navigation
Python: Create Terminal error command noise included when default shell is fish #4959
Description
Activity
- ghost addedtriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
on Mar 27, 2019 - addedbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug
on Mar 27, 2019 - ghost removedtriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
on Mar 27, 2019 - addedtriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
on Mar 27, 2019 - ghost removedtriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
on Mar 27, 2019 Yes, this is quite annoying and happens every time I create a new terminal instance when working in a Python project. IMO there is no reason to be sourcing conda's
bin/activate. The sane default is definitely for the user to setup their environment to already include conda's activate, and the python extension's only responsibility should be to activate the correct conda environment.Reacted by Rohan Gautam, André, Cornelius Roemer, imyhxy, Christian Ciach and Benjamin ElbersI'm having the same issue and the path of
condacan potentially be obtained frompython.condaPathAs for today the bug persists, if you just want to get rid of the anooying error just uncheck the python > terminal: Activate Environment settings and activate the environment manually.
Reacted by KageyamaRuka, Bjørn Ådlandsvik, Wayearn, tigertang, David Godding and Tejasvi S. TomarReacted by Rohan GautamReacted by Michał Mrówkasame bug
Yes!!!!! This is so annoying
See also this SO question, which was answered by Brett Cannon (@brettcannon). Unfortunately, even after
conda init fishthis still seems to be a problem.Are there any workarounds (besides disabling automatic activation)?
any update? can we just execute
conda activate envnamewith thesource xxxthings?No specific update right now, but we do have plans to rework how we activate terminals via #11039 which will implicitly solve this.
And yes, you can do the activation manually. You can also launch VS Code from an activated environment and then turn off automatic activation as another work-around.
Reacted by Rohan Gautam, imyhxy and Christian CiachUnfortunately, even after conda init fish this still seems to be a problem.
With #18989 we now ensure
source activatecommand is only sent if the shell is not initialized already (conda is not sourced), so this should no longer be an issue, closing this.Reacted by Varun Arora and imyhxy- locked as resolved and limited conversation to collaborators
on Jul 8, 2022
Issue Type: Bug
Executing
Python: Create terminalgives this output in the open terminalThe line noise above comes from the fact that
anaconda3/bin/activateis sh/bash syntax and not compatible with fish.I think I see roughtly two possible approaches to fixing this:
Option 1
Assume that the user has already run the appropriate conda.fish script within their shell setup context in order to make conda available for use within their shell. For example in my ~/.config/fish/config.fish I have
Which ensures (for conda 4.4 and greater) that 'conda` is in my PATH and that 'conda activate' will work correctly for use from the fish shell.
If this tact is used, then I would expect Python: Create Terminal to look like this
Option 2
If its not desirable to assume the user has setup their shell appropriately for conda -- then I think it would be needed to invoke the correct conda.{sh,fish,...} setup script for each shell. The activate script would work with bash shell I think but if the user's shell is fish the output should look like this
I believe that last sequence will only work with anaconda 4.4 and greater -the pre-4.4 version of conda.fish assumed that the
condacommand had already been added to the user PATH -- whereas post 4.4 configures PATH to include the appropriate conda binary such that conda binary'sconda activatecommand will work correctly with the fish shell. Conda notes on the 4.4 changesExtension version: 2019.3.6139
VS Code version: Code 1.32.3 (a3db5be9b5c6ba46bb7555ec5d60178ecc2eaae4, 2019-03-14T22:46:48.547Z)
OS version: Darwin x64 18.2.0
System Info
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled