microsoft / microsoft/vscode-remote-release
venv in a wsl remote terminal is not activated when .bash_aliases has a powershell command
Nobody has claimed this yet.
- Dominant language
- Dockerfile
- Stars
- 4.2k
- Forks
- 470
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
- VSCode Version: 1,15.1
- Local OS Version: Windows 10 20H2
- Remote OS Version: Ubuntu 18.04
- Remote Extension/Connection Type: WSL
Steps to Reproduce:
-
Put the below in your
.bash_aliasesecho $(pwsh.exe -noprofile -c echo hi)
-
Open a terminal in vscode when a editing some Python file -
venvdoes not get activated. Looks like it's invoked before the terminal is ready. Here is the output in the terminal (noteretaileris myvenvname):source /home/uri/.virtualenvs/retailer/bin/activate
hi
uri@milky-way:~/git/retailer-adapter$
BTW, if my .bash_aliases file is
echo $(echo bye)
everything works well and this is the output I get:
bye
uri@milky-way:~/git/retailer-adapter$ source /home/uri/.virtualenvs/retailer/bin/activate
(retailer) uri@milky-way:~/git/retailer-adapter$
Also, to put things in context, note the steps to reproduce are a simplification of the actual use case. I need to set some environment variable from the output of a command only available in powershell.
export VAR=$(pwsh.exe -c ...)
Does this issue occur when you try this locally?: No
Does this issue occur when you try this locally and all extensions are disabled?: No
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue using the .bash_aliases examples and a VS Code WSL terminal while editing a Python file. Compare the PowerShell command case with the nested echo case, then trace terminal startup and virtual-environment activation. Done means the venv is activated after shell initialization even when .bash_aliases runs a PowerShell command.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, powershell, python, ubuntu, vscode
- Domain
- cli, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100