Remove netcat dependency (#28920)

Closes #28813
Closes #27749

Release Notes:

- Removed the need to have openbsd `netcat` (`nc`) installed on your
system in order to enter passwords for `git` or `ssh` (remote
development). If you previously installed `netcat` specifically for Zed,
you may uninstall it.
This commit is contained in:
Ben Kunkle 2025-04-16 19:46:36 -04:00 committed by GitHub
parent 63b4b60b79
commit cbb6c221b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 72 additions and 22 deletions

View file

@ -23,6 +23,7 @@ test-support = ["fs/test-support"]
[dependencies]
anyhow.workspace = true
askpass.workspace = true
async-watch.workspace = true
backtrace = "0.3"
chrono.workspace = true

View file

@ -8,6 +8,10 @@ use std::path::PathBuf;
struct Cli {
#[command(subcommand)]
command: Option<Commands>,
/// Used for SSH/Git password authentication, to remove the need for netcat as a dependency,
/// by having Zed act like netcat communicating over a Unix socket.
#[arg(long, hide = true)]
askpass: Option<String>,
}
#[derive(Subcommand)]
@ -46,6 +50,11 @@ fn main() {
let cli = Cli::parse();
if let Some(socket_path) = &cli.askpass {
askpass::main(socket_path);
return;
}
let result = match cli.command {
Some(Commands::Run {
log_file,