code-server: [Bug]: Cannot invoke `code-server` from integrated terminal
Is there an existing issue for this?
- I have searched the existing issues
OS/Web Information
- Web Browser: Firefox 102
- Local OS: Win10
- Remote OS: Ubuntu
- Remote Architecture: 86
code-server --version: 4.5.0 (4.4.0)
Steps to Reproduce
- docker run codeserver:latest
- try to install extensions via code-server
code-server --install-extension ms-python - asd
Expected
Installation of Extension
Actual
Console throws error
/usr/lib/code-server/lib/vscode/bin/remote-cli/code-server: 12: /usr/lib/code-server/lib/vscode/node: not found
Logs
No response
Screenshot/Video
No response
Does this issue happen in VS Code or GitHub Codespaces?
- I cannot reproduce this in VS Code.
- I cannot reproduce this in GitHub Codespaces.
Are you accessing code-server over HTTPS?
- I am using HTTPS.
Notes
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 21 (17 by maintainers)
Commits related to this issue
- Update latest Dockerfile - Fix https://github.com/coder/code-server/issues/5335 — committed to b-data/jupyterlab-r-docker-stack by benz0li 2 years ago
Will be resolved by #5360
My pretty simple idea would be to check inside the code-server script it’s location. So in case of being inside the
remote-clifolder instead of thebinit maybe would be a solution to change the way thenodelocation is detected.So I might be wrong but the only location where upstream vs code prepends the PATH variable with the remote-cli folder is here:
https://github.com/microsoft/vscode/blob/619ab6d1ba7eef9ad418456a5fe5c7805f01a7ab/src/vs/server/node/extensionHostConnection.ts#L53-L59
This is also used to spawn the console (https://github.com/microsoft/vscode/blob/619ab6d1ba7eef9ad418456a5fe5c7805f01a7ab/src/vs/server/node/remoteTerminalChannel.ts#L191) so thats prop. the locaiton where the env variable and thus the PATH gets broken
Interesting 🤔 I’ll chat with @code-asher and see how we can fix this. Thanks for bringing it up everyone!
I think what’s going on is upstream
vscodeis injecting an update to thePATHenvironment variable to an undesirable location.Here is my invocation that generates the error (note: specifically running
/opt/code-server/bin/code-server(where I installed code-server in my container) bypasses the issue):And here is my
$PATH:I certainly did not put
/opt/code-server/lib/vscode/bin/remote-cliinto my PATH myself.