[Error] Cursor/VSCode can't ssh into distrobox since the init script sent over the connection is hijacked by distrobox init script
- Lingua principale
- Go
- Stelle
- 13k
- Fork
- 541
- Merge medio
- 20h 47m
- PR unite (30g)
- 4
Descrizione
The general setup is:
1. Run distrobox on a remote machine with an open ssh connection in it.
2. Use some IDE (e.g. Cursor) on the developer's laptop to remotely run and edit code in said distrobox over SSH. Using the anysphere remote ssh plugin.
Bug:
The init script never runs, and the IDE can't connect to the box
Underlying cause:
The lines in the [distrobox-init ](https://github.com/89luca89/distrobox/blob/next/internal/inside-distrobox/assets/distrobox-init) that read environment variables for graphic apps hijack the stdin, which anysphere relies on to pass the script, an old but common method of doing it, and the script never runs.
A likely fix:
Change lines 2231-2249 to include a /dev/null redirect, so for example, instead of
```export XAUTHORITY="\$(host-spawn sh -c "printf "%s" \\\$XAUTHORITY")"```
It should be:
```export XAUTHORITY="$(host-spawn < /dev/null sh -c "printf "%s" \$XAUTHORITY")"```
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.