Skip to content

Use "terminal.integrated.inheritEnv": false for fish users #8341

Closed

Description

Environment data

  • VS Code version: 1.39.2
  • Extension version (available under the Extensions sidebar): 2019.11-dev
  • OS and version: macOS Mojave
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.7.5
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Relevant/affected Python packages and their versions: N/A
  • 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): N/A

Using fish 3.0.2

Expected behaviour

To be able to have virtual environment activation succeed without errors.

Actual behaviour

Welcome to fish, the friendly interactive shell
 (master *) > source /Users/brettcannon/Repositories/brettcannon/caniusepython3/.venv/bin/activate.fish
functions: Function '_old_fish_prompt' does not exist
~/Repositories/brettcannon/caniusepython3/.venv/bin/activate.fish (line 22): 
        functions -c _old_fish_prompt fish_prompt
        ^
in function 'deactivate'
        called on line 30 of file ~/Repositories/brettcannon/caniusepython3/.venv/bin/activate.fish
        with parameter list 'nondestructive'

from sourcing file ~/Repositories/brettcannon/caniusepython3/.venv/bin/activate.fish
        called on standard input


       functions - print or erase functions

   Synopsis
       functions [ -a | --all ] [ -n | --names ]
       functions [ -D | --details ] [ -v ] FUNCTION
       functions -c OLDNAME NEWNAME
       functions -d DESCRIPTION FUNCTION
       functions [ -e | -q ] FUNCTIONS...

functions: Type 'help functions' for related documentation

functions: Function 'fish_prompt' does not exist
~/Repositories/brettcannon/caniusepython3/.venv/bin/activate.fish (line 47): 
    functions -c fish_prompt _old_fish_prompt
    ^
from sourcing file ~/Repositories/brettcannon/caniusepython3/.venv/bin/activate.fish
        called on standard input


       functions - print or erase functions

   Synopsis
       functions [ -a | --all ] [ -n | --names ]
       functions [ -D | --details ] [ -v ] FUNCTION
       functions -c OLDNAME NEWNAME
       functions -d DESCRIPTION FUNCTION
       functions [ -e | -q ] FUNCTIONS...

functions: Type 'help functions' for related documentation

fish: Unknown command _old_fish_prompt
~/Repositories/brettcannon/caniusepython3/.venv/bin/activate.fish (line 71): 
        _old_fish_prompt
        ^
in function 'fish_prompt'
        called on standard input

in command substitution
        called on standard input

Steps to reproduce:

  1. Set "terminal.integrated.inheritEnv": true in your settings
  2. Create a virtual environment
  3. Set your shell to fish
  4. Open a new terminal that will trigger virtual environment activation

(You can also get the same effect by manually running source on activate.fish.)

Activity

  1. added
    bug
    triage-needed
    on Nov 1, 2019
  2. added
    needs proposal
    on Nov 4, 2019
  3. ghost removed
    triage-needed
    on Nov 4, 2019
  4. ibqn commented on Nov 6, 2019

    @ibqn

    I also have this error message.

  5. TinyAtoms commented on Nov 19, 2019

    @TinyAtoms

    I'm going to continue our discussion here, since it's probably more relevant to your issue.

    As I mentioned over there, I can get venv working with fish as well by manually activating activate.fish

    https://i.imgur.com/gsoxznP.png in plain terminal
    https://i.imgur.com/cYPf8gJ.png in vscode

    Now I'm kinda curious why it doesn't work for you and not for me.
    Maybe different fish setups?

    Also, have you tried raising the issue at the fish-shell people? At a glance, there doesn't appear to be any open issues with venv/virtualenv, and this sounds a lot more like a fish problem than a vscode issue

  6. brettcannon commented on Nov 19, 2019

    @brettcannon
    MemberAuthor

    TinyAtoms nope, not raised it upstream yet since it is resolved by undoing an odd thing that VS Code does. But it wouldn't hurt either, so I will raised it upstream when I have the time.

  7. added
    needs spike
    and removed
    needs proposal
    on Aug 18, 2020
  8. sahilrajput03 commented on Oct 23, 2020

    @sahilrajput03

    idk what you are tryig actually but do check my issue with fish and vscode got resolved, and I'm happy.

    microsoft/vscode#105344

    Brett Cannon (@brettcannon)

  9. brettcannon commented on Dec 14, 2022

    @brettcannon
    MemberAuthor

    I haven't seen this issue crop up in some time, so I'm closing as fixed.

  10. locked as resolved and limited conversation to collaborators on Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-terminalbugneeds spike

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions