Skip to main content

sanitize_external_command

Function sanitize_external_command 

Source
pub fn sanitize_external_command(cmd: &mut Command)
Expand description

Strip every AGENTMUX_* variable, including the in-pane helper keep-set.

For processes that are neither ours nor helpers: provider CLIs launched for OAuth login (server/identity_auth_spawn.rs). Those are third-party, network-connected binaries, so even PANE_ENV_KEEP is too generous — AGENTMUX_LOCAL_URL would hand them this instance’s API endpoint, and AGENTMUX_AUTH_KEY the credential to it. muxsh needs those; claude login does not.

The nesting sentinel is still set: it carries no identity, and it stops a launcher started anywhere below from adopting ambient state.