Remote transport for Flatpak host #56435
blue42u
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Body
What are you proposing?
A new option to "remote" into the host system via
flatpak-spawn --hostandzed-server. This command can be used whenever Zed is running inside a Flatpak sandbox (i.e. whenZED_FLATPAK_NO_ESCAPE=1is set), and would be suggested as a toast when opening a project.Why does this matter?
The only available support for Flatpak re-spawns the entire editor on the host system (so-called "escape mode"). This approach causes crashes when host processes are involved, including:
LD_LIBRARY_PATHinto application - including zed terminals flathub/dev.zed.Zed#330Those who worked around the above issues disabled the Flatpak escape (so-called "sandbox mode"), leading to a different set of issues:
flatpak-spawnas the terminal shell)As a result of the poor experience both ways, the community-led Flathub package has "waffled" between disabling the sandbox escape (flathub/dev.zed.Zed#275) and ultimately reverting that change (flathub/dev.zed.Zed#352). Neither approach is making everyone happy.
The Flathub package gets 10,000+ downloads a month, with over 200,000 total installs. These many users of Zed would benefit greatly from a smoother Flatpak experience than upstream Zed currently provides.
Are there any examples or context?
ptyxis-agentThe approach suggested below builds on the recently added Dev Containers support, which uses
zed-serverto access a "remote" container environment much like the already provenptyxis-agentapproach. This avoids the invasive changes previously proposed for Flatpak support in #11949.Possible approach
(I don't claim to know anything about the Zed codebase, but my idea is:)
The
RemoteConnectionarchitecture can be extended to support this use case, using the same structure asDockerExecConnection(Dev Container support). In this scenario thezed-serverruns on the "remote" (host) system and provides access to the host development environment:This is structurally very similar to the Docker transport, the main difference being the wrapper command (
flatpak-spawn --host ...instead ofdocker exec ...). For further simplicity, thezed-serverbinary can be bundled in the Flatpak and executed via its host-side path, using the sameflatpak::get_flatpak_dir()used for the "escape" code today.Additional notes
No code changes are needed to enable Dev Container support while the editor is sandboxed, it only requires
docker/podmanCLIs and sockets inside the Flatpak sandbox. See Add support for Devcontainers in sandbox mode flathub/dev.zed.Zed#342 for an implementation.There is potential synergy with devcontainers: run git on the host #54613: if "Git on host" is enabled,
git(and other core CLIs) can be installed/used inside the Flatpak sandbox even on systems where these tools are unavailable (or broken/old) on the host. This would be especially handy for end-user-oriented distros or where package installs are difficult (e.g. atomic OSs and managed systems), as a lightweight alternative to a full Dev Container setup.Beta Was this translation helpful? Give feedback.
All reactions