-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Cannot invoke code-server
from integrated terminal
#5335
Comments
"Workaround" is a downgrade to 4.4.0 #5334 also has a bug appearently solved by downgrading. |
I have the same issue but need 4.5.0 as it's required to run Github Copilot. Any other ideas for a workaround? |
I think what's going on is upstream Here is my invocation that generates the error (note: specifically running
And here is my
I certainly did not put |
cc @code-asher any ideas on this one? |
@jsjoeio I can confirm this. JupyterLab Terminal: $ echo $PATH
/opt/code-server/bin:/opt/julia/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin code-server Terminal: $ echo $PATH
/opt/code-server/lib/vscode/bin/remote-cli:/opt/code-server/bin:/opt/julia/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 👉 Compare ( |
This should have been fixed prior to the release of code-server v4.5.1. I am sticking with v4.4.0 for now. |
The way |
Interesting 🤔 I'll chat with @code-asher and see how we can fix this. Thanks for bringing it up everyone! |
@code-asher Compare ( |
So I might be wrong but the only location where upstream vs code prepends the PATH variable with the remote-cli folder is here: 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 |
My pretty simple idea would be to check inside the code-server script it's location. |
Uhh yeah |
Or maybe we patch to prevent it from getting added to the |
code-server
from integrated terminal
Applying diff --git a/opt/code-server/lib/vscode/bin/remote-cli/code-server b/opt/code-server/lib/vscode/bin/remote-cli/code-server
index bd8c43b..94bbf1e 100755
--- a/opt/code-server/lib/vscode/bin/remote-cli/code-server
+++ b/opt/code-server/lib/vscode/bin/remote-cli/code-server
@@ -9,4 +9,4 @@ VERSION="1.68.1"
COMMIT="30d9c6cd9483b2cc586687151bcbcd635f373630"
EXEC_NAME="code-server"
CLI_SCRIPT="$ROOT/out/server-cli.js"
-"$ROOT/node" "$CLI_SCRIPT" "$APP_NAME" "$VERSION" "$COMMIT" "$EXEC_NAME" "$@"
+"$ROOT/../node" "$CLI_SCRIPT" "$APP_NAME" "$VERSION" "$COMMIT" "$EXEC_NAME" "$@" results in $ code-server --version
1.68.1
30d9c6cd9483b2cc586687151bcbcd635f373630
x64 when executed in code-server Terminal. Compared to
when executed in JupyterLab Terminal. $ /opt/code-server/bin/code-server --help
code-server 4.5.1 97d170331b51ee75c8e4bbdab23c755e3eeaaa8c with Code 1.68.1
Usage: code-server [options] [path]
- Opening a directory: code-server ./path/to/your/project
- Opening a saved workspace: code-server ./path/to/your/project.code-workspace
Options
--auth The type of authentication to use. [password, none]
--password The password for password authentication (can only be passed in via $PASSWORD or the config file).
--hashed-password The password hashed with argon2 for password authentication (can only be passed in via $HASHED_PASSWORD or the config file).
Takes precedence over 'password'.
--cert Path to certificate. A self signed certificate is generated if none is provided.
--cert-host Hostname to use when generating a self signed certificate.
--cert-key Path to certificate key when using non-generated cert.
--disable-telemetry Disable telemetry.
--disable-update-check Disable update check. Without this flag, code-server checks every 6 hours against the latest github release and
then notifies you once every week that a new release is available.
--disable-file-downloads Disable file downloads from Code. This can also be set with CS_DISABLE_FILE_DOWNLOADS set to 'true' or '1'.
-h --help Show this output.
--open Open in browser on startup. Does not work remotely.
--bind-addr Address to bind to in host:port. You can also use $PORT to override the port.
--config Path to yaml config file. Every flag maps directly to a key in the config file.
--socket Path to a socket (bind-addr will be ignored).
--socket-mode File mode of the socket.
-v --version Display version information.
--user-data-dir Path to the user data directory.
--extensions-dir Path to the extensions directory.
--list-extensions List installed VS Code extensions.
--force Avoid prompts when installing VS Code extensions.
--install-extension Install or update a VS Code extension by id or vsix. The identifier of an extension is `${publisher}.${name}`.
To install a specific version provide `@${version}`. For example: '[email protected]'.
--enable-proposed-api Enable proposed API features for extensions. Can receive one or more extension IDs to enable individually.
--uninstall-extension Uninstall a VS Code extension by id.
--show-versions Show VS Code extension versions.
--github-auth GitHub authentication token (can only be passed in via $GITHUB_TOKEN or the config file).
--proxy-domain Domain used for proxying ports.
-e --ignore-last-opened Ignore the last opened directory or workspace in favor of an empty window.
-n --new-window Force to open a new window.
-r --reuse-window Force to open a file or folder in an already opened window.
-vvv --verbose Enable verbose logging.
--link (deprecated) Securely bind code-server via our cloud service with the passed name. You'll get a URL like
https://hostname-username.coder.co at which you can easily access your code-server instance.
Authorization is done via GitHub. vs
|
If
you should
|
I'm currently trying what happens if I simply remove the code-server script located in |
@code-asher In code-server v4.4.0/v4.3.0 there is My workaround is renaming
code-server v4.4.0: $ tree /opt/code-server/lib/vscode/bin
/opt/code-server/lib/vscode/bin
├── code-server-oss
├── helpers
│ └── browser.sh
└── remote-cli
└── code-oss
2 directories, 3 files
$ cat /opt/code-server/lib/vscode/bin/code-server-oss
#!/usr/bin/env sh
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
case "$1" in
--inspect*) INSPECT="$1"; shift;;
esac
ROOT="$(dirname "$(dirname "$(readlink -f "$0")")")"
"$ROOT/node" ${INSPECT:-} "$ROOT/out/server-main.js" "$@"
$ cat /opt/code-server/lib/vscode/bin/helpers/browser.sh
#!/usr/bin/env sh
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
ROOT=$(dirname "$(dirname "$(dirname "$0")")")
APP_NAME="code-oss"
VERSION="1.66.2"
COMMIT=","
EXEC_NAME="code-oss"
CLI_SCRIPT="$ROOT/out/server-cli.js"
"$ROOT/node" "$CLI_SCRIPT" "$APP_NAME" "$VERSION" "$COMMIT" "$EXEC_NAME" "--openExternal" "$@"
$ cat /opt/code-server/lib/vscode/bin/remote-cli/code-oss
#!/usr/bin/env sh
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
ROOT=$(dirname "$(dirname "$(dirname "$0")")")
APP_NAME="code-oss"
VERSION="1.66.2"
COMMIT=","
EXEC_NAME="code-oss"
CLI_SCRIPT="$ROOT/out/server-cli.js"
"$ROOT/node" "$CLI_SCRIPT" "$APP_NAME" "$VERSION" "$COMMIT" "$EXEC_NAME" "$@" |
In code-server v4.1.0 |
Will be resolved by #5360 |
Is there an existing issue for this?
OS/Web Information
code-server --version
: 4.5.0 (4.4.0)Steps to Reproduce
code-server --install-extension ms-python
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?
Are you accessing code-server over HTTPS?
Notes
No response
The text was updated successfully, but these errors were encountered: