flathub / flathub/com.visualstudio.code

flatpak-run invocations don't share IPC socket

Aperta
#210 8 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Shell
Stelle
217
Fork
82
Merge medio
1g 7h
PR unite (30g)
1

Descrizione

Visual Studio Code is designed to run as a single process within the session: if you run `code /someproject` and then `code --new-window /some/other/project` the idea is that the second invocation opens `/vscode--.sock` and asks the initial process to open the second window, where:

```
: $XDG_RUNTIME_DIR if set, otherwise the VSCode userDataDir
: a truncated md5sum of userDataDir
: 1.54.2 or whatever
```

But with the Flatpak, every invocation of `flatpak-run com.visualstudio.code` gets a new temporary $XDG_RUNTIME_DIR created.

This makes `alias code="flatpak run com.visualstudio.code"` not work very well.

I don't have a great idea for a solution:

* I've created a workaround wrapper script that uses `flatpak ps` and, if an existing process is found, `flatpak enter` - but `flatpak enter` is more a development facility then something to use in production.
* If the wrapper script unset $XDG_RUNTIME_DIR, then the socket would be created within `~/.var/app/com.visualstudio.code/config/Code/`, which might work OK. I don't think sharing the user data dir on a NFS home directory would work well anyways.
* Some sort of Flatpak feature added to share $XDG_RUNTIME_DIR between `flatpak run` invocations?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start by reproducing multiple `flatpak run com.visualstudio.code` invocations and inspect how each one sets `XDG_RUNTIME_DIR` and locates the VS Code IPC socket. Compare the proposed `flatpak ps`/`flatpak enter` wrapper approach with the userDataDir fallback; done means successive invocations can communicate and open the requested second window.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
vscode
Ambito
desktop
Tipo di issue
Bug
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.