Skip to content

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

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.

Activity

  1. added this to the May 2023 milestone on May 25, 2023
  2. karrtikr commented on May 26, 2023

    @karrtikr
    Author
  3. removed this from the May 2023 milestone on May 26, 2023
  4. locked as resolved and limited conversation to collaborators on Jun 26, 2023
  5. changed the title [-]Test multiroot support for terminal activation using environment variables[/-] [+]Test terminal prompt for multiroot workspace when in `pythonTerminalEnvVarActivation` experiment[/+] on Aug 14, 2023
  6. changed the title [-]Test terminal prompt for multiroot workspace when in `pythonTerminalEnvVarActivation` experiment[/-] [+]Test terminal prompt when activating terminals using environment variables[/+] on Aug 14, 2023
  7. changed the title [-]Test terminal prompt when activating terminals using environment variables[/-] [+]Test that UI indicates terminal activation when activating using environment variables[/+] on Aug 14, 2023
  8. 4 remaining items

  9. eleanorjboyd commented on Aug 29, 2023

    @eleanorjboyd
    Member

    mine always says (base) PS C:\Users\eleanorboyd\testFilesWindows\conda-shell> is it ok that it says base and not .venv?

  10. karrtikr commented on Aug 29, 2023

    @karrtikr
    Author

    Yes you can ignore that for now. Please run the Python command specified to see which environment is actually activated.

  11. karrtikr commented on Aug 29, 2023

    @karrtikr
    Author

    This isn't working for me at all:

    Me and Aaron discussed here that it actually works: #21887 (comment), but it was the same confusion that Eleanor Boyd (@eleanorjboyd) has, which is that it always shows (base) regardless of which env is actually activated.

    Sorry for the trouble.

  12. lramos15 commented on Aug 29, 2023

    @lramos15
    Member

    Is it standard for Python docs to be in a GH wiki. I'm wondering if this should be on the VS Code website so we can track things like page views?

  13. karrtikr commented on Aug 29, 2023

    @karrtikr
    Author

    Logan Ramos (@lramos15) We have plans to move it there, but right now this is behind an experiment hence isn't applicable for everyone.

  14. unlocked this conversation on Aug 29, 2023
  15. karrtikr commented on Aug 29, 2023

    @karrtikr
    Author

    image

    Logan Ramos (@lramos15) Were you able to test for zsh and fish on Linux?

  16. lramos15 commented on Aug 29, 2023

    @lramos15
    Member

    image

    Logan Ramos (@lramos15) Were you able to test for zsh and fish on Linux?

    Oh I do not have those installed, do I need to install them for the TPI. I got confused by the wording please tick whatever is available in your OS which made me think it was test what you have.

  17. karrtikr commented on Aug 29, 2023

    @karrtikr
    Author

    Sorry, if you could install them that would be great. Our codespaces already has it pre-installed so you can also use that, thanks!

  18. lramos15 commented on Aug 29, 2023

    @lramos15
    Member

    Sorry, if you could install them that would be great. Our codespaces already has it pre-installed so you can also use that, thanks!

    Done 👍

  19. locked as resolved and limited conversation to collaborators on Sep 29, 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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions