Skip to content

Expose job environment to ShellSafeArg in tmux - #78

Open
hartikainen wants to merge 6 commits into
google-deepmind:mainfrom
hartikainen:fix-tmux-shellsafe-env
Open

hartikainen wants to merge 6 commits into
google-deepmind:mainfrom
hartikainen:fix-tmux-shellsafe-env

Conversation

@hartikainen

@hartikainen hartikainen commented Aug 27, 2026

Copy link
Copy Markdown

tmux prefixes environment assignments to the executable command. The shell therefore expands ShellSafeArg values before those assignments take effect. Export the job environment first and preserve the launch command when printing it for reuse.

This was diagnosed and fixed by an LLM.

Arguments that require POSIX shell quoting reach Docker, Vertex, and
Kubernetes with literal quote characters because those backends pass the
serialized tokens directly as `argv`. This separates shell-fragment
serialization from direct-`argv` serialization, uses POSIX quoting for
`tmux`, and emits Docker `ENTRYPOINT` arguments through `json.dumps`.
@hartikainen
hartikainen force-pushed the fix-tmux-shellsafe-env branch 2 times, most recently from abdcefd to 78a036f Compare August 27, 2026 21:32
`tmux` prefixes environment assignments to the executable command. The
shell therefore expands `ShellSafeArg` values before those assignments
take effect. Export the job environment first, and reprint the launch
command with `printf`, which does not interpret the backslash escapes
that `echo` does in `sh`.
@hartikainen
hartikainen force-pushed the fix-tmux-shellsafe-env branch from 78a036f to 242f74b Compare August 28, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant