From ae095d2262230cd23d8c23c16115900156641984 Mon Sep 17 00:00:00 2001 From: Liam Hupfer Date: Mon, 19 May 2025 22:01:33 -0500 Subject: [PATCH] flatpak: Add --device=all permission Without --device=all, the sandbox gets a dedicated PTY namespace. Commands run on the host via the HostCommand D-Bus interface receive the file descriptors from the namespaced PTY but cannot determine its path via ttyname(3). This breaks commands like tty(1), ps(1) and emacsclient(1). Add --device=all so the host PTY namespace is used when allocating TTYs. Applications with access to org.freedesktop.Flatpak can already give themselves arbitrary permissions, so the sandboxing benefits of restricted device access are limited. For terminal emulators, the primary benefit of Flatpak is the predictability of the distro-independent target runtime rather than sandboxing. --- flatpak/com.mitchellh.ghostty.Devel.yml | 2 ++ flatpak/com.mitchellh.ghostty.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/flatpak/com.mitchellh.ghostty.Devel.yml b/flatpak/com.mitchellh.ghostty.Devel.yml index 244c3987f..fe24a7c56 100644 --- a/flatpak/com.mitchellh.ghostty.Devel.yml +++ b/flatpak/com.mitchellh.ghostty.Devel.yml @@ -14,6 +14,8 @@ desktop-file-name-suffix: " (Devel)" finish-args: # 3D rendering - --device=dri + # use host PTS namespace + - --device=all # Windowing - --share=ipc - --socket=fallback-x11 diff --git a/flatpak/com.mitchellh.ghostty.yml b/flatpak/com.mitchellh.ghostty.yml index 17c92633f..1b119c11b 100644 --- a/flatpak/com.mitchellh.ghostty.yml +++ b/flatpak/com.mitchellh.ghostty.yml @@ -9,6 +9,8 @@ command: ghostty finish-args: # 3D rendering - --device=dri + # use host PTS namespace + - --device=all # Windowing - --share=ipc - --socket=fallback-x11