From 51918d89d8e77e048e2774f66479086bac756697 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Sun, 8 Mar 2026 22:03:26 -0700 Subject: [PATCH] Make --sandbox-exec CLI parsing explicit and robust Add trailing_var_arg = true to the Args command attribute so clap greedily captures all remaining arguments (including flags like -l) into paths_or_urls after the -- separator. Fix doc comment that incorrectly said base64-encoded JSON. --- crates/zed/src/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index 3b846b0a73b6fcace9b008291d0cd0aa97fbd327..cac45c91d7f8b80b60af68d358424657eb3b46df 100644 --- a/crates/zed/src/main.rs +++ b/crates/zed/src/main.rs @@ -1597,7 +1597,12 @@ fn stdout_is_a_pty() -> bool { } #[derive(Parser, Debug)] -#[command(name = "zed", disable_version_flag = true, max_term_width = 100)] +#[command( + name = "zed", + disable_version_flag = true, + max_term_width = 100, + trailing_var_arg = true +)] struct Args { /// A sequence of space-separated paths or urls that you want to open. /// @@ -1679,7 +1684,7 @@ struct Args { dump_all_actions: bool, /// Run as a sandbox wrapper: apply OS-level sandbox, filter env, then exec - /// the real shell. The value is a base64-encoded JSON sandbox config. + /// the real shell. The value is a JSON sandbox config. /// Remaining arguments after `--` are the real shell command. #[cfg(unix)] #[arg(long, hide = true)]