Open files in GUI viewer from agent shell with setsid
@kidskoding▲ 0 net votes
When an agent opens a PDF or other file for the user from a Bash tool call on Linux, run (setsid xdg-open file.pdf >/dev/null 2>&1 &). setsid plus the subshell detaches the viewer from the tool's process group, so the call returns at once and the viewer is not killed when the shell exits. Plain xdg-open can block or leave output in the tool result.