Skip to content

Support for Virtual environment activation with /bin/sh #18936

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
peppermintpatty5 opened this issue Apr 17, 2022 · 3 comments
Closed

Support for Virtual environment activation with /bin/sh #18936

peppermintpatty5 opened this issue Apr 17, 2022 · 3 comments
Labels
area-terminal community ask Feature request that the community expressed interest in feature-request Request for new features or functionality

Comments

@peppermintpatty5
Copy link

peppermintpatty5 commented Apr 17, 2022

Issue Type: Bug

Behaviour

Expected vs. Actual

I expect the virtual environment to be activated with the proper shell command, but instead the output is:

$ source /[redacted]/env/bin/activate
/bin/sh: 1: source: not found

This problem can be resolved by using . (POSIX compliant) instead of source (Bash specific). For example:

. ./env/bin/activate

Steps to reproduce:

  1. Switch Linux shell profile to sh.

    {
        "terminal.integrated.defaultProfile.linux": "sh"
    }
    
  2. Open the integrated terminal in any Python workspace that has a virtual environment installed.

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.10.4
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
  • Value of the python.languageServer setting: Pylance
User Settings


defaultLS: {"defaultLSType":"Pylance"}

downloadLanguageServer: true

envFile: "<placeholder>"

venvPath: "<placeholder>"

venvFolders: "<placeholder>"

condaPath: "<placeholder>"

pipenvPath: "<placeholder>"

poetryPath: "<placeholder>"

languageServer: "Pylance"

linting
• enabled: true
• cwd: "<placeholder>"
• Flake8Args: "<placeholder>"
• flake8Enabled: false
• flake8Path: "<placeholder>"
• lintOnSave: true
• banditArgs: "<placeholder>"
• banditEnabled: false
• banditPath: "<placeholder>"
• mypyArgs: "<placeholder>"
• mypyEnabled: false
• mypyPath: "<placeholder>"
• pycodestyleArgs: "<placeholder>"
• pycodestyleEnabled: false
• pycodestylePath: "<placeholder>"
• prospectorArgs: "<placeholder>"
• prospectorEnabled: false
• prospectorPath: "<placeholder>"
• pydocstyleArgs: "<placeholder>"
• pydocstyleEnabled: false
• pydocstylePath: "<placeholder>"
• pylamaArgs: "<placeholder>"
• pylamaEnabled: false
• pylamaPath: "<placeholder>"
• pylintArgs: "<placeholder>"
• pylintPath: "<placeholder>"

sortImports
• args: "<placeholder>"
• path: "<placeholder>"

formatting
• autopep8Args: "<placeholder>"
• autopep8Path: "<placeholder>"
• provider: "black"
• blackArgs: "<placeholder>"
• blackPath: "<placeholder>"
• yapfArgs: "<placeholder>"
• yapfPath: "<placeholder>"

testing
• cwd: "<placeholder>"
• debugPort: 3000
• nosetestArgs: "<placeholder>"
• nosetestsEnabled: undefined
• nosetestPath: "<placeholder>"
• promptToConfigure: true
• pytestArgs: "<placeholder>"
• pytestEnabled: false
• pytestPath: "<placeholder>"
• unittestArgs: "<placeholder>"
• unittestEnabled: false
• autoTestDiscoverOnSaveEnabled: true

terminal
• activateEnvironment: true
• executeInFileDir: "<placeholder>"
• launchArgs: "<placeholder>"

experiments
• enabled: true
• optInto: []
• optOutFrom: []

tensorBoard
• logDirectory: "<placeholder>"

Extension version: 2022.4.1
VS Code version: Code 1.66.2 (dfd34e8260c270da74b5c2d86d61aee4b6d56977, 2022-04-11T07:49:24.808Z)
OS version: Linux x64 5.13.0-39-generic
Restricted Mode: No

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Apr 17, 2022
@karthiknadig karthiknadig changed the title Virtual environment activation with /bin/sh Support for Virtual environment activation with /bin/sh Apr 18, 2022
@karthiknadig karthiknadig added feature-request Request for new features or functionality area-terminal needs community feedback Awaiting community feedback and removed triage-needed Needs assignment to the proper sub-team labels Apr 18, 2022
@karthiknadig
Copy link
Member

We currently don't have support for sh, hence turning this into a feature request.

Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.

@brettcannon
Copy link
Member

Thank you to everyone who upvoted this issue! Since the community showed interest in this feature request we will leave this issue open as something to consider implementing at some point in the future.

We do encourage people to continue 👍 the first/opening comment as it helps us prioritize our work based on what the community seems to want the most.

@brettcannon brettcannon added needs proposal Need to make some design decisions community ask Feature request that the community expressed interest in and removed needs community feedback Awaiting community feedback labels Jun 16, 2022
@karrtikr
Copy link

Should be fixed with #2559 (comment), give it a try.

@karrtikr karrtikr closed this as not planned Won't fix, can't repro, duplicate, stale Sep 11, 2023
@github-actions github-actions bot removed the needs proposal Need to make some design decisions label Sep 11, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-terminal community ask Feature request that the community expressed interest in feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

4 participants