code-server version: v1.1119-vsc1.33.1When using --open switch, code-server starts correctly but fails to actually open the browser:
$ code-server --host 127.0.0.1 --allow-http --no-auth --disable-telemetry --open dev/0x40.ale.sh/
(node:18645) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
INFO code-server v1.1119-vsc1.33.1
...
WARN Url couldn't be opened automatically. {"url":"http://localhost:8443/","exception":{"errno":"ENOENT","code":"ENOENT","syscall":"spawn /src/packages/server/out/xdg-open","path":"/src/packages/server/out/xdg-open","spawnargs":["http://localhost:8443/"]}}
...
Perhaps you wanted to use a system xdg-open instead? :)
(PS Thanks for this awesome tool, and for [sail], too!)
It looks like it wanted to use xdg-open. You could ctrl + click the URL that was printed before this warning.
Note: This is also just a warning, so there is nothing to really worry about.
Edit:
Reproduced while using sail.
Steps:
sail run cdr/sailsail shell cdr/sailcode-server --host 127.0.0.1 --allow-http --no-auth --disable-telemetry --open dev/0x40.ale.sh/open includes it's own version of xdg-open and prefers to use that whenever possible, but this doesn't work in binaries produced by nbin.
I created a PR on open to add an option for always using the system version instead of the bundled version of xdg-open: https://github.com/sindresorhus/open/pull/138. Once this is merged, we can enable this option in cli.ts.
It looks like open takes an app argument so that could also be an option.
A fix (https://github.com/sindresorhus/open/pull/140, version 6.4.0) was merged into open that checks if the local xdg-open is executable before using it, which should solve this specific problem. Once we've confirmed it's working we can close this issue.
Fixed in #819.
Most helpful comment
openincludes it's own version ofxdg-openand prefers to use that whenever possible, but this doesn't work in binaries produced by nbin.I created a PR on
opento add an option for always using the system version instead of the bundled version ofxdg-open: https://github.com/sindresorhus/open/pull/138. Once this is merged, we can enable this option in cli.ts.