Replace environment variable parser with zed --printenv outputting JSON (#32637)

Closes: https://github.com/zed-industries/zed/issues/32445
Follow-up to: https://github.com/zed-industries/zed/pull/31799

Release Notes:

- Improved handling of environment variables

---------

Co-authored-by: Conrad Irwin <conrad@zed.dev>
This commit is contained in:
Peter Tripp 2025-06-13 11:49:15 -04:00 committed by GitHub
parent d280c95d91
commit 71dbe88459
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 77 additions and 371 deletions

View file

@ -191,11 +191,18 @@ Error: Running Zed as root or via sudo is unsupported.
let args = Args::parse();
// `zed --askpass` Makes zed operate in nc/netcat mode for use with askpass
if let Some(socket) = &args.askpass {
askpass::main(socket);
return;
}
// `zed --printenv` Outputs environment variables as JSON to stdout
if args.printenv {
util::shell_env::print_env();
return;
}
if args.dump_all_actions {
dump_all_gpui_actions();
return;
@ -1071,6 +1078,10 @@ struct Args {
#[arg(long, hide = true)]
dump_all_actions: bool,
/// Output current environment variables as JSON to stdout
#[arg(long, hide = true)]
printenv: bool,
}
#[derive(Clone, Debug)]