microsoft / microsoft/vscode-remote-release
${execPath} has wrong value in a Container Remote
@alexr00 is already working on this.
Since Jul 27, 2020.
- Dominant language
- Dockerfile
- Stars
- 4.2k
- Forks
- 470
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
- VSCode Version: 1.47.2
- Local OS Version: Ubuntu 20.04
- Remote OS Version: Gentoo 4.15.0
- Remote Extension/Connection Type: Docker using SSH remote host
Steps to Reproduce:
- Set
"docker.host": "ssh://me@remote", - Set
"terminal.integrated.shellArgs.linux": ["--login"], - Open a workspace I have set to
/depotinside the remote container - Create a task to open some file in VSCode
{
"label": "open gen.c",
"type": "shell",
"command": "${execPath} /depot/out/cur/gen/${fileBasenameNoExtension}.c",
"problemMatcher": []
},
- Run the task
> Executing task in folder depot: /snap/code/38/usr/share/code/code /depot/out/cur/gen/foo.c <
/bin/bash: /snap/code/38/usr/share/code/code: No such file or directory
The terminal process "/bin/bash '--login', '-c', '/snap/code/38/usr/share/code/code /depot/out/cur/gen/foo.c '" failed to launch (exit code: 127).
Wait a second, that's the path to code running on my local machine! In a remote context I would expect ${execPath} to resolve to the code instance running inside the container, thus allowing you to open the file in the current VSCode window:
(without --login)
user@user /depot $ which code
/home/user/.vscode-server/bin/<hash>/bin/code
Unfortunately I can't just use code because some of our tools need a login shell and the login profile clobbers the shell's PATH variable that VSCode normally adds itself to for this to work. I also have several /home/user/.vscode-server/bin/<hash> folders and looping over them seems bad.
I also can't use shell and automationShell differently since other tasks rely on the login shell as well.
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.
Assessment
This issue has not been assessed yet.