Skip to content

If automatic shell integration is failing to activate environment, recommend users to do manual installation #23113

Description

@karrtikr

In a lot of cases with remote scenario or complex shell setups, automatic shell integration fails silently, due to which environment variable written by us in terminal gets overwritten by the shell integration script, leading to issues with failed activation. This is due to a limitation on VS Code's end:

image

Manual installation solves the problem in those cases, which requires users to edit their shell initialization scripts.

Once microsoft/vscode#145234 is done, we can now detect whether automatic shell integration is failing or not:

  • Launch a hidden terminal and run:
python -c"import sys;print(sys.executable)
  • Check whether it's the same as selected environment

If it is not, we can show a notification to users suggesting manual installation. We can either:

  • Ask them to do it themselves, which from my experience with such issues, every user is able to do easily
  • Guide them to do it, we already have an implementation for it where we asked users to install deactivate command in their init script (link):
    • Open corresponding shell initialization script on their behalf
    • Suggest the edit they need to make enclosed by markers

Activity

  1. removed their assignment
    on Mar 22, 2024
  2. eleanorjboyd commented on Dec 8, 2025

    @eleanorjboyd
    Member

    closing this as a ton has changed with the switch to the Python Environments Extension

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions