open
actions create zombie xdg-open processes
#5999
Unanswered
AnthonyZhOon
asked this question in
Issue Triage
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Open1 actions do not perform wait() and directly use
std.process.Child.spawn()
to create the subprocess. This results in zombiexdg-open
processes that are not reaped until the parentghostty
process exits and theinit
command takes ownership and perform child reaping.Environment
Reproduction
ghostty
Open Configuration
(keybind or context menu)xdg-open
process is left as a child of the runningghostty
processzombie.webm2
Potential solutions
The double-fork method, intially create a spawner, which immediately spawns the subprocess
xdg-open
, the spawner immediately exits after, returning responsiveness to theghostty
thread. When the grandchildxdg-open
exits, after its direct-parent has exited, its parent becomes the nearest ancestor child-reaper3, usuallyinit
which should reap it. As a result, we unconditionally wait on the short-lived spawner process instead.Note:
I tried simply adding a .wait() on the
xdg-open
process inopen.zig
1 but this did not result in ghostty being responsive.It appears
xdg-open
waits for its children before itself exiting.There's other solutions listed at this stackoverflow.
I was concerned when a zombie xdg-open had helix pinning a core at 100% after ghostty exited.
Footnotes
Open URL, config, or scrollback relying on open.zig ↩ ↩2
libreoffice-writer is the only GUI app I have installed that advertises support for MIME text/plain, don't judge ↩
UNIX process lifecycle management language is as grim as ever ↩
Beta Was this translation helpful? Give feedback.
All reactions