code-server
code-server copied to clipboard
[Bug]: When using the command "code-server --install-extension", a failed installation returns exit code 0
Is there an existing issue for this?
- [X] I have searched the existing issues
OS/Web Information
- Local OS: macOS
- Remote OS: Ubuntu
- Remote Architecture: amd64
code-server --version: 4.11.0
Steps to Reproduce
- On the Terminal run
code-server --install-extension non.existing-extension && echo "Exit code: " "$?" - Wait for the command to finish and check the output.
Expected
At the end of the output it should read:
Exit code: 1
Or any other non 0 appropriate exit code.
Actual
At the end of the output it reads:
Exit code: 1
Logs
No response
Screenshot/Video
No response
Does this issue happen in VS Code or GitHub Codespaces?
- [X] I cannot reproduce this in VS Code.
- [X] I cannot reproduce this in GitHub Codespaces.
Are you accessing code-server over HTTPS?
- [X] I am using HTTPS.
Notes
As part of a pipeline, I have a script that install some extensions using code-server --install-extension, whenever one of the installed extensions fails I expect the whole script to fail, cascading to the pipeline fail so I can take action.
Instead, as it is returning 0 even when the task is failing, the build finishes with a false success.
@SantiSuarezMS don't you mean: "Actual: At the end of the output it reads: Exit code 0" (instead of 1) ?
I consider this a bug as well, or at least bad UX, as one can not use this command in a script and react to failing. Any comments from a contributor/developer on this?
I can reproduce this in GitHub Codespaces.
And it is present in both <install-path>/bin/code-server (i.e. code-server called from Terminal) as well as <install-path>/lib/vscode/bin/remote-cli/code-server (i.e. code-server called from code-server's Terminal).
IMHO rather a vscode (remote-cli) issue than a code-server issue.
not exactly sure what you mean by "vscode (remot-cli)" but ms vscode (v1.84.2) behaves correctly: code --install-extension non.existing-extension will return 1. vscodium as well behaves correctly.
Yeah in the integrated terminal we just use the script that comes bundled with VS Code (the server/web CLI is different than the native one) so it sounds like an upstream bug.
We can fix what we can on our end though, the one that runs outside the integrated terminal. Will push that fix in a bit.
Edit: This one still does not quite work because the error does not appear to propagate so there is nothing to catch, but that needs to be fixed upstream.
Can we please an issue on the upstream repo then? I would like to do so, but as i'm not familiar with the server/web CLI version, i'm not sure where to place and how to describe it correctly..
Sorry for letting this fall through the cracks. If someone wants to submit this upstream, I think it should be sufficient to reproduce in Codespaces (I believe the command there will be code though and not code-server) and use that information to open the issue.
note this does work as expected in the microsoft code-server version
I tested after updating to 1.88.0 but unfortunately the problem persists. Not sure why Microsoft's works. :thinking: Does it work within the integrated terminal as well, or only outside? Codespace's is still broken too.
Ah nevermind I tested, it does not work in the integrated terminal with Microsoft's either.
Wait, I see why. I can fix the exit code from the external script, but the one from the integrated terminal is still an upstream bug.
I will go ahead and close this as an upstream bug.