Under systemd, pane commands have $VAR and $$ expanded by systemd-run #57
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?
Panes start through
systemd-run --user --scope, which since systemd 254 expands$VAR/${VAR}(from the manager environment) and turns$$into$in the command before the shell sees it. Soillogical run "echo $$"printed$, and any$VARin a run/restore command got the manager's value or nothing. Also, panes inherited the service's NOTIFY_SOCKET/LISTEN_*/INVOCATION_ID, so a dev daemon started in a pane took itself for the systemd service (scopes, FD store).Found while fixing the macOS CI (questions.rs
claude_code_in_a_terminal_asks_through_its_hookfails whencargo testruns inside a pane of the systemd daemon). Fixed on branchci-mac-fix:--expand-environment=nowhen systemd-run is >= 254, and the service env is removed from panes and agents. Test:a_command_reaches_its_shell_as_written_under_systemd.Fixed on main in
3aa929c(merge of ci-mac-fix,55962d3): systemd-run gets --expand-environment=no on 254+, and the service's own environment (sys::SERVICE_ENV) no longer reaches panes or agents. Test: a_command_reaches_its_shell_as_written_under_systemd. Found during #55.