Skip to content
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

ENOENT when using --open on Linux #727

Closed
notpushkin opened this issue May 28, 2019 · 5 comments · Fixed by #857
Closed

ENOENT when using --open on Linux #727

notpushkin opened this issue May 28, 2019 · 5 comments · Fixed by #857
Labels
bug Something isn't working

Comments

@notpushkin
Copy link
Contributor

  • code-server version: v1.1119-vsc1.33.1
  • OS Version: Ubuntu 18.10 on local computer

Description

When 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!)

@notpushkin notpushkin added the bug Something isn't working label May 28, 2019
@teddy-codes
Copy link

teddy-codes commented May 28, 2019

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/sail
  • sail shell cdr/sail
  • code-server --host 127.0.0.1 --allow-http --no-auth --disable-telemetry --open dev/0x40.ale.sh/

@deansheather
Copy link
Member

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: sindresorhus/open#138. Once this is merged, we can enable this option in cli.ts.

@code-asher
Copy link
Member

It looks like open takes an app argument so that could also be an option.

@deansheather
Copy link
Member

A fix (sindresorhus/open#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.

@deansheather
Copy link
Member

Fixed in #819.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants