Set an environment variable when spawning a login shell

This commit is contained in:
Iain 2025-08-24 11:44:14 +08:00 committed by GitHub
parent 1b91f3de41
commit af30cab46b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,6 +15,7 @@ pub fn capture(directory: &std::path::Path) -> Result<collections::HashMap<Strin
let mut command_string = String::new(); let mut command_string = String::new();
let mut command = std::process::Command::new(&shell_path); let mut command = std::process::Command::new(&shell_path);
command.env("ZED_CAPTURE_ENVIRONMENT", "1");
// In some shells, file descriptors greater than 2 cannot be used in interactive mode, // In some shells, file descriptors greater than 2 cannot be used in interactive mode,
// so file descriptor 0 (stdin) is used instead. This impacts zsh, old bash; perhaps others. // so file descriptor 0 (stdin) is used instead. This impacts zsh, old bash; perhaps others.
// See: https://github.com/zed-industries/zed/pull/32136#issuecomment-2999645482 // See: https://github.com/zed-industries/zed/pull/32136#issuecomment-2999645482