Fall back to plain foot when no foot server is running - #229
Open
kacperpaczos wants to merge 1 commit into
Open
Conversation
The Foot entry in the supported-terminals table launches footclient, which is only a thin client: it needs a foot --server listening on its socket and exits with code 220 - no terminal window - when there is none. Mirror footclient(1)'s socket lookup (foot-$WAYLAND_DISPLAY.sock, foot.sock under $XDG_RUNTIME_DIR, /tmp/foot.sock) and hand back plain foot when no server socket exists. foot and footclient take the command positionally and both ignore -e, so the swap is drop-in. Fixes the Foot preference silently doing nothing for users who do not run a foot server.
This was referenced Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #228
The Foot entry in the supported-terminals table always launches
footclient, but footclient is only a thin client: it needs afoot --serverlistening on its socket, and exits with code 220 — no terminal window — when there is none. So choosing Foot without a running server made every terminal action silently do nothing.This mirrors footclient(1)'s socket lookup —
$XDG_RUNTIME_DIR/foot-$WAYLAND_DISPLAY.sock, then$XDG_RUNTIME_DIR/foot.sockwhen$WAYLAND_DISPLAYis unset, then/tmp/foot.sock— and launches plainfootinstead when no socket exists (andfootis installed; otherwise the choice is left as it was). With a live server footclient is used exactly as before, so server users keep the fast client. The swap is drop-in: foot and footclient both take the command positionally, and both accept-and-ignore-efor xterm compatibility (foot(1), footclient(1)), which is the separator this table already uses.In the Flatpak the check asks the host (
flatpak-spawn --host test -e), because the sandbox mounts its own runtime dir where a host-side server's socket is not visible — and the terminal itself is spawned on the host anyway.One assumption worth flagging: the check is "does the default socket path exist", not "can it be connected to". A stale socket left behind by a crashed server still picks footclient, and a server started with a custom
--server <path>socket is missed — in that case plain foot still opens a working terminal, just not through the server. I have asked the reporter in #228 whether either case applies to their setup.Testing
A unit test pins the socket lookup order against footclient(1). End to end, with stub
foot/footclientbinaries that log their invocations, an isolated settings backend with Foot selected, andXDG_RUNTIME_DIR/WAYLAND_DISPLAYpointed at a scratch directory, clicking Open Terminal gives:The flatpak-sandbox branch of the check is the one part I could not exercise end to end here (native install); it degrades to the plain-foot fallback if the host query fails.