microsoft / microsoft/vscode-remote-release
SetEnv and SendEnv are ignored when connecting to remote host
Nobody has claimed this yet.
- Dominant language
- Dockerfile
- Stars
- 4.2k
- Forks
- 469
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
Is there an existing issue for this bug?
- I have searched the existing open issues and found none that apply.
- If I find any issue of interest that is related or closed, I will included a link to it in this issue.
Required Troubleshooting Steps
- I have read and performed the troubleshooting steps
- I have tried both values of the
remote.SSH.useLocalServersetting - My issue was not covered in the Tips and Tricks linked from the Troubleshooting Wiki.
- I will include a complete copy of my Remote - SSH logs by running Remote-SSH: Show Log in the command palette or from View > Output in the menu bar
[Optional] Diagnose with Copilot
I asked @remote-ssh but it did not help
In step 2 of the troubleshooting wiki, what was the result of running the generated SSH command verbatim outside of VS Code?
I COULD successfully SSH to the remote machine with the generated SSH command
Remote-SSH Log
Relevant issue https://github.com/microsoft/vscode-remote-release/issues/2344#issue-563952756
In the issue above the problem was solved after killing vscode remote server; however after I tried this, it didn't work for me and after connecting again the setEnv in ssh was still ignored.
Expected Behavior
Variables set with SetEnv and SendEnv should be available in vscode, similar to how they are available when connecting with normal ssh.
Actual Behavior
Variables set with SetEnv and SendEnv are not in the environment.
Steps To Reproduce
Steps to reproduce are the same as in the linked issue.
- In the server, add AcceptEnv GIT_AUTHOR_NAME in /etc/ssh/sshd_config
- Restart sshd systemctl restart sshd
- Locally, add SetEnv GIT_AUTHOR_NAME="Maxime" to your ssh_config
- Kill remote vscode server
- Connect via SSH to the server
- Run printenv | grep GIT. No match found.
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
Start by reviewing the linked issue #2344 and comparing the generated SSH command with the Remote-SSH connection behavior. Reproduce with SetEnv, SendEnv, AcceptEnv, and the documented server restart steps, then use printenv to verify the result. Done means the configured variables are available in the VS Code remote environment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100