Skip to content

Test notification system for setting up deactivate command #22288

@karrtikr

Description

@karrtikr

Refs: #22121

Complexity: 5

Create Issue


Requirements

  • Python extension pre-release & VS Code Insiders
  • Basic terminal shell types, please install if necessary and tick once tested:
    • Windows:
      • cmd
      • powershell
      • powershellcore
    • Linux (our codespaces already have these installed):
      • bash
      • zsh
      • fish
    • macOS :
      • bash
      • zsh
      • powershellcore

Background

Traditionally, activation script (<venv>/<bin>/activate) was run to activate terminals, which registered the deactivate command as well. But now that we're using environment variables to activate terminals instead, deactivate command is broken as it never gets registered.

To make it work, this we added a notification system which helps user register the "deactivate" command in their shell init script.

Verification

  • Add following to user settings and reload window:
"python.experiments.optInto": ["pythonTerminalEnvVarActivation"]
  • Open a workspace folder and activate Python extension by opening a Python file.

  • Use Create environment command to select a venv

  • Loop -> Do the following for all terminal shell types:

    • Open a new terminal.
    • Make sure terminal is activated using the selected environment. Run the following in terminal:
      python -c"import sys;print(sys.executable)"
      
    • Output should contain the path to interpreter selected. For eg. for .venv it looks something like:
      C:\Users\karraj\OneDrive - Microsoft\Desktop\folders\crap\.venv\Scripts\python.exe
      
    • Run "deactivate" command in terminal, a similar notification should show up:
      image
    • Verify clicking "learn more" points to appropriate wiki.
    • After following through with the notification, ensure deactivate command works:
      image
    • Change the default shell in your OS using Terminal: Select Default Profile, say bash->fish

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions