devcontainers / devcontainers/features
No xdg-open command, so host Browser cannot be started
- Lingua principale
- Shell
- Stelle
- 1.5k
- Fork
- 621
- Merge medio
- 6g 53m
- PR unite (30g)
- 9
Descrizione
When starting a browser by executing cli on a terminal in devcontainer (VSCode Remote - Container), if the browser startup depends on xdg-open, it will fail because the xdg-open command does not exist.
For example, the following is obtained by executing cdktf init.
```
$ cdktf init --template="typescript"
Welcome to CDK for Terraform!
By default, cdktf allows you to manage the state of your stacks using Terraform Cloud for free.
cdktf will request an API token for app.terraform.io using your browser.
If login is successful, cdktf will store the token in plain text in
the following file for use by subsequent Terraform commands:
/home/node/.terraform.d/credentials.tfrc.json
Note: The local storage mode isn't recommended for storing the state of your stacks.
? Do you want to continue with Terraform Cloud remote state management? Yes
opening webpage using your browser.....
If the web browser didn't open the window automatically, you can go to the following url:
https://app.terraform.io/app/settings/tokens?source=terraform-login
? Token for app.terraform.io 🔑 [input is hidden] /usr/local/share/npm-global/lib/node_modules/cdktf-cli/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
throw ex;
^
Error: spawn xdg-open ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn xdg-open',
path: 'xdg-open',
spawnargs: [
'https://app.terraform.io/app/settings/tokens?source=terraform-login'
]
}
```
CLI tools that use the environment variable BROWSER, such as github-cli, are not affected, but there must be many CLI tools that use xdg-open.
I originally submitted the form below, but I thought it was a devcontainer issue, so I submitted it here.
https://github.com/hashicorp/terraform-cdk/issues/2132
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia riproducendo il malfunzionamento con `cdktf init --template="typescript"` all’interno di un devcontainer di VS Code e verifica in che modo il container fornisce i comandi per aprire il browser. Il lavoro è completato quando il malfunzionamento segnalato `spawn xdg-open ENOENT` è risolto, mentre l’URL di fallback rimane utilizzabile; il payload non indica file del repository o test da esaminare.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- docker, shell, vscode
- Ambito
- cli, devops
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100