helix
helix copied to clipboard
Fix for lost clipboard contents (#5424)
Fixes the issue described in #5424
The code has been changed so that for unix type platforms a call is made to libc::setsid
using the unix specific CommandExt pre_exec.
The setsid
call happens just after fork
has been called and before execve
is called. This means it runs in the context of the child process.
The call is necessary to ensure that spawned child processes related to the clipboard (e.g. xclip
) have a distinct process session ID and process group ID.
Without this change when the parent process exits, the child (i.e. xclip
), can be erroneously killed leading to copy/paste breaking in some specific circumstances such as those detailed in #5424