daemon: systemd-run expands $VAR and $$ in pane and agent commands #56
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found during #55 (while working on #53).
Under a systemd user service, panes and agent servers start through
systemd-run --user --scope. Since systemd 254, systemd-run expands environment variables in the command's arguments (--expand-environment, on by default; with--scopesystemd-run does it itself). So a pane command likesh -c 'echo $$'runs assh -c 'echo $', and${VAR}takes the daemon's value (or nothing) before the shell sees it.It shows as
claude_code_in_a_terminal_asks_through_its_hookandthe_terminal_answering_first_closes_the_cardfailing (the pid file holds$) whenever the tests run with NOTIFY_SOCKET set (e.g. from a pane of a daemon under systemd), on systemd 259.Fix: pass
--expand-environment=nowhen systemd-run accepts it (probed once at start, so older systemd still works). Fixed on branch i53-alt-snapshot.Duplicate of #57, fixed on main in
3aa929c. Dropped this branch's copy of the fix before merging #53.