mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-29 19:14:13 +00:00
Closes #45271 Zed hardcodes `ControlMaster=yes` with a `ControlPath` in a random temp directory, so it can never find a ControlMaster session the user already has open. This means you get prompted for credentials again even if you're already authenticated. This patch checks for an existing master before spawning a new one. It runs `ssh -G` to resolve the user's configured `controlpath` (with `%h`, `%p`, etc. already expanded), then `ssh -O check` to verify it's alive. If it is, Zed skips askpass and uses the existing socket. If not, the current behavior is unchanged. Both commands are local and don't hit the network. Also adds a `killed: AtomicBool` to `SshRemoteConnection` because `has_been_killed()` was using `master_process.is_none()` as a proxy for "connection is dead." When reusing an external master, `master_process` starts as `None`, so the connection pool would discard it immediately. Tested against a university SSH setup with `ControlMaster auto` configured. The reuse path connects without prompting, and the fallback path works normally when no master exists. Windows is unaffected. Release Notes: - Zed now reuses existing SSH ControlMaster sessions instead of prompting for credentials again (#45271). |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| LICENSE-GPL | ||