Skip to content

Test that UI indicates terminal activation when activating using environment variables #21298

Closed
@karrtikr

Description

@karrtikr

Refs: #21793

Complexity: 5

Create Issue


Requirements

Similar to #21102 hence preassigning.

  • Python extension pre-release
  • Latest VSCode Insiders
  • Ability to create virtual environment
    • Use python -m venv <name> to create virtual envs.
  • Ability to create conda environment
  • Basic terminal shell types, please tick whatever is available in your OS:
    • Windows:
      • cmd
      • powershell
      • powershellcore
    • Linux:
      • bash
      • zsh
      • fish
    • macOS :
      • bash
      • zsh
  • Nice to have:
    • sh
    • ksh
    • csh
    • tcsh
    • nushell
    • xonsh

Verification

  • Add following to user settings and reload window:
"python.experiments.optInto": ["pythonTerminalEnvVarActivation"]
  • Run conda config --set auto_activate_base True.

  • Open a workspace folder and activate Python extension by opening a Python file.

  • Select a virtual environment using Python: Select Interpreter command.

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

    • Open a new terminal.
    • Ensure we indicate the env is activated in at least one of the following ways:
    • 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 created via python -m venv .venv it looks something like:
      C:\Users\karraj\OneDrive - Microsoft\Desktop\folders\crap\.venv\Scripts\python.exe
      
    • Change the default shell in your OS using Terminal: Select Default Profile, say bash->fish
  • Select a conda environment using Python: Select Interpreter command and repeat the above loop.

  • If the notification was visible at some point:

    • Verify clicking "learn more" opens this wiki.
    • Verify that opening a new terminal after clicking "Don't show again" does not show the notification.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions