Skip to content

.env does not apply to fish when in pythonTerminalEnvVarActivation experiment #22005

Closed

Description

@karrtikr

I actually need this to prevent VS Code from cluttering my shell history, otherwise my history is filled up with entries such as source /some/path/.venv/bin/activate.fish and /some/path/.venv/bin/python /some/path/src/myscript.py or subsequent commands I tried for that specific project which are irrelevant as my shell history in my general day to day usage!

Setting terminal.integrated.shellIntegration.history to 0 did not have any effect, at least on my fish shell, not sure if it's a bug or I'm missing something! Nor did having fish_history= in a .env file and opting into the newly introduced "python.experiments.optInto": [ "pythonTerminalEnvVarActivation" ].

Originally posted by Kyochikuto | キョウチクトウ (@kyochikuto) in microsoft/vscode#192943 (comment)

Activity

  1. added
    bugIssue identified by VS Code Team member as probable bug
    triage-neededNeeds assignment to the proper sub-team
    on Sep 15, 2023
  2. karrtikr commented on Sep 15, 2023

    @karrtikr
    Author

    Kyochikuto | キョウチクトウ (@kyochikuto) Fix should be out in the pre-release version of the extension, use the following to try it out:

    image

  3. karrtikr commented on Sep 16, 2023

    @karrtikr
    Author

    Hey Kyochikuto | キョウチクトウ (@kyochikuto) , if you still see source /some/path/.venv/bin/activate.fish then you're not in the experiment. Can you add that setting in User settings and reload window?

  4. karrtikr commented on Sep 16, 2023

    @karrtikr
    Author

    Try this, make sure to add it in User settings when using latest stable version of VS Code:

    "python.experiments.optInto": ["pythonTerminalEnvVarActivation"]
    
  5. karrtikr commented on Sep 16, 2023

    @karrtikr
    Author

    Thanks for the logs, looks like source /some/path/.venv/bin/activate.fish isn't sent anymore based on it which is expected in the experiment.

    If you notice there's a line "Setting environment variable FISH_HISTORY in collection to" in the logs, this issue has been fixed in the latest pre-release (we now set fish_history instead of FISH_HISTORY), but I just noticed that it's only available on VS Code Insiders. Sorry about that.

    If you could try https://code.visualstudio.com/insiders/ I'm positive this issue should go away, we'll release this fix in the stable VS Code in about a month.

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

Metadata

Metadata

Labels

area-terminalbugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions