## Summary
Remove verbose syntax pattern by adopting `trim_{prefix,suffix}`, which
sometimes saves clones or other work.
`value.strip_suffix(pattern).unwrap(value)` ->
`value.trim_suffix(pattern)`
`value.strip_prefix(pattern).unwrap(value)` ->
`value.trim_prefix(pattern)`
I also found a common pattern of `.starts_with` before `strip_prefix`,
which the latter already checks for implicitly.
## Testing
Tests pass, no behavior changes.
## Self-review
- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.
Release Notes:
- N/A
- [GPUI] N/A
Opening a remote project while its workspace was still reconnecting
started a second client with the same `workspace-{id}` server
identifier. The new proxy killed the old server, the old client's
reconnect attached to the new server, and each reconnect killed the SSH
master that both clients shared, so neither connection settled. The new
client then waited out the full 60s initial timeout although its proxy
had already exited with 255.
- `open_remote_project` now focuses a workspace that is reconnecting and
waits for the reconnect to end, instead of starting a second client.
- A new `RemoteClient` stops any older live client with the same
identifier and cancels its reconnect loop, which covers the entry points
that skip workspace matching.
- The initial connection fails as soon as the proxy exits, instead of
after the 60s timeout.
Release Notes:
- Improved remote server reconnect for the same workspace
## Summary
Fixes rustc and clippy warnings for a potential upcoming Rust 1.100
version bump. All changes are backwards compatible and Rust is **not**
bumped in this PR.
## Self-review
- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.
Release Notes:
- N/A
- [GPUI] N/A
---------
Co-authored-by: Finn Evers <finn.evers@outlook.de>
## Summary
Closes#66813
`ssh://host/C:/project` (and `zed://ssh/host/C:/...`) sends
`/C:/project` to the remote, because a URL path keeps a `/` before a
Windows drive letter. A Windows remote server cannot canonicalize that
path (os error 123), so the project fails to open with
`DevServerProjectPathDoesNotExist`.
This is a follow-up to #66497, which fixed the same leading `/` for
local `file://` and `zed://file` links. That fix could not be reused
here: it checks the local OS while the URL is parsed, and for SSH the
remote's OS is only known after connecting. This change strips the slash
in `determine_paths_with_positions`, which runs after the connection and
can ask the remote for its path style. Paths on Unix remotes and `/~`
paths are left alone.
Before (Zed 1.27.0):
<img width="420" height="225" alt="zed-ssh-drive-letter-error"
src="https://github.com/user-attachments/assets/ee33b4e7-4dae-43a1-8bfa-8b85c8302ebe"
/>
After (this branch, same URL):
<img width="620" height="140" alt="zed-ssh-drive-letter-fixed"
src="https://github.com/user-attachments/assets/a937839c-f8ba-4f2e-9fb0-9ca1a91380be"
/>
## Testing
- Windows 11 Pro with OpenSSH Server, connected to itself over
`localhost` (setup in #66813).
- Zed 1.27.0: `zed
ssh://zed-win-repro/C:/Users/<user>/zed-ssh-repro/project` fails with
`DevServerProjectPathDoesNotExist path=/C:/...`.
- This branch, debug build, with the remote server built from the same
commit: the same URL opens the project, and the worktree is
`C:\Users\<user>\zed-ssh-repro\project`.
- `cargo test -p recent_projects --lib remote_connections`: 6 passed,
including the new `test_strip_slash_before_drive_letter`, which covers
both path styles and the paths that must stay unchanged.
- `cargo clippy -p recent_projects --tests`: no warnings.
To test a debug build against a Windows remote: the debug remote server
panics outside the checkout ("dev asset loading requires running from
within the checkout"), so build it with `cargo build -p remote_server
--features util/debug-embed` and set `ZED_COPY_REMOTE_SERVER` to
`target/debug/remote-server.exe`.
## Self-review
- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist). (No UI
changes.)
- [x] Tests cover the new or changed behavior.
Release Notes:
- Fixed `ssh://` links with a drive letter (for example
`ssh://user@host/C:/project`) failing to open a project on a Windows
remote.
## Summary
Closes#64605
Switching branches in a remote project streams the entire commit graph
from the server to the client, even with the History tab closed. On the
reporter's 313k-commit clone that is about 27 MB per switch, on the same
SSH connection the terminal and file-open requests are waiting on. The
same transfer happens once on every remote project open.
The Git panel reacts to every repository change with
`preload_commit_history`, which asks the repository for `0..0` commits
so the data is ready if the user opens History. The range only limits
what is read back from the cache. If the cache is empty, because
`HeadChanged` just cleared it, a full `git log` starts anyway, and for a
remote project `GetInitialGraphData` streams every commit regardless of
range.
`preload_commit_history` now returns early when the project is not
local. Local projects keep the preload, where it is a background `git
log` and no bytes cross a wire. Remote projects load history when the
user opens the History tab, through `load_commit_history`, which already
does that.
This trades a remote stall for a remote delay on first open: the first
time History is opened over SSH it shows the loading state while the
graph streams, instead of being ready. That is the same transfer that
happens today, moved to the moment the user asks for it, and skipped if
they never do.
The preload was not achieving readiness on remote projects anyway. A
branch switch reaches the client as a head change followed by a
branch-list change, and the branch-list change clears the cache the
preload just filled. When the two arrive together the fetch is cancelled
before its request leaves. When they arrive apart, the request has
already gone out and the host streams the full graph into a cache entry
that no longer exists.
The follow-up that pages the remote graph transfer, so the History tab
and Git graph load incrementally, is open as a draft in #65442.
## Testing
Added
`collab::git_tests::test_ssh_branch_switch_does_not_fetch_history`, an
SSH project built with `build_ssh_project` against a headless server:
1. Opens the project with the Git panel on Changes and checks no history
fetch started.
2. Switches the host to another branch, checks the client sees it, and
checks no history fetch started.
3. Opens History through `ActivateHistoryTab` and checks exactly one
fetch ran and the panel lists the host's commits.
Fetches are counted where they start on the client, through a test-only
counter on `Repository`, not by inspecting the cache, because the
branch-list update after a switch clears the cache and would hide a
fetch that had already started. With the fix removed, the test fails at
step 1 with `opening the project with Changes selected should not fetch
history`, and with that check relaxed it fails at step 2 with `switching
branches with Changes selected should not fetch history`.
Green: `cargo test -p collab --test collab_tests git_tests` (14), `cargo
test -p git_ui` (180), `cargo test -p project --lib git_store` (25),
`./script/clippy -p project -p git_ui -p collab --tests`.
To reproduce by hand: open a large repository over SSH, leave the Git
panel on Changes, switch branches in the terminal, and watch the
connection; after this change nothing is transferred.
## Self-review
- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist). No UI
changes.
- [x] Tests cover the new or changed behavior.
Release Notes:
- Fixed branch switches in remote projects resending the full Git
history over SSH, which stalled the terminal and file opening until the
transfer finished
---------
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
## Summary
Closes#65575
When connecting over SSH to a Windows remote server, Zed forwards
commands that need to be executed (for example terminals and tasks)
through `ssh`. The logic lives in `build_command_windows()` in
`crates/remote/src/transport/ssh.rs`. The command built on the client
looks like this:
```
ssh -t <remote_server> powershell -E <command_base64>
```
Zed passes `powershell -E <command_base64>` to `ssh` as the remote
command. The Windows OpenSSH server appends it as-is to
`<ssh_remote_shell> <shell_command_option>`, so the command that
actually runs on the remote server is:
```
<ssh_remote_shell> <shell_command_option> powershell -E <command_base64>
```
For `cmd.exe`, which is the default Windows OpenSSH server shell, the
final command is:
```
cmd.exe /c powershell -E <command_base64>
```
This works fine. However, if the default shell is changed to `nu`, the
final command becomes:
```
nu -c powershell -E <command_base64>
```
Here `nu` treats `powershell` as the only command to execute and passes
`-E <command_base64>` to itself as flags. `-E` is not a flag of `nu`, so
we get the following error:
```
The nu command doesn't have the flag '-E'
```
To fix this, the command is now wrapped in literal quotes when it is
sent, so that the command line executed on the remote server becomes:
```
<ssh_remote_shell> <shell_command_option> "powershell -E <command_base64>"
```
This way, `powershell -E <command_base64>` is always interpreted as a
single command, regardless of the shell.
## Testing
I checked the process creation on the Windows remote with Procmon:
- Before the change, `nu` was launched as `nu -c powershell -E
<command_base64>`.
- After the change, it is launched as `nu -c "powershell -E
<command_base64>"`, which runs successfully.
I also manually tested `nu`, `pwsh`, `powershell`, and `cmd` as the
Windows OpenSSH server default shell. Terminals and tasks work correctly
with all of them.
## Self-review
- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [ ] Tests cover the new or changed behavior.
Release Notes:
- Fixed the remote terminal and tasks failing on Windows SSH servers
whose default shell is Nushell
## Why
Remote Projects accepts either a bare destination or a full `ssh ...`
command. Commands that tools print with every token shell-quoted (for
example `'ssh' '-p' '64042' 'user@127.0.0.1'`) work in a shell but Zed
rejects them with `unsupported argument`. The goal is that any valid SSH
command pasted into **Connect New Server** parses the same way whether
or not its tokens are quoted.
Closes#61101
## Summary
`SshConnectionOptions::parse_command_line` stripped a literal, unquoted
`ssh ` prefix from the raw string before tokenizing. With a quoted
`'ssh'`, the prefix didn't match, so after tokenizing `ssh` became the
hostname and the real destination was rejected as an extra argument.
This change tokenizes first and then drops a leading `ssh` token when
more tokens follow. A lone `ssh` is still treated as a hostname, as
before.
## Testing
- Added `test_parse_command_line_with_ssh_executable` covering unquoted,
single-quoted (including an identity path with spaces), and
double-quoted `ssh` executables, plus `ssh` used as a host. It fails on
`main` with `unsupported argument: "user@127.0.0.1"` and passes with
this change.
- `cargo test -p remote`: 56 passed
- `cargo fmt -p remote -- --check`
- `./script/clippy -p remote`
## Self-review
- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist). (No UI
changes.)
- [x] Tests cover the new or changed behavior.
AI disclosure: this change was AI-assisted. I reviewed the diff and the
test.
Release Notes:
- Fixed Remote Projects rejecting SSH commands whose `ssh` executable is
shell-quoted.
## Summary
This cleans up the gpui_platform code a bit, and in combination the way
we set up the http client for the web. This does introduce a
`ForegroundExecutor` variant that it itself is Send-able, allowing to
dispatch foreground futures from background workers (by requiring the
future to be Send, unlike `ForegroundExecutor`), which is a requirement
for web fetch.
a31c7b54c60738b82524e4e4c12aec2f6caf101d fixes a bunch of warnings with
our binary names
Release Notes:
- [gpui] N/A
## Summary
Closes#58773
While working on this, I noticed that project grouping and workspace
lookup used different connection comparisons. I unified them around the
existing `RemoteConnectionIdentity`.
I also simplified the relevant code, removing redundant lookup and
comparison helpers and borrowing values instead of cloning them when the
caller only needs to read the data.
## Testing
Added corresponding test coverage
## Self-review
- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.
Release Notes:
- Fixed local files opening as empty buffers in remote workspaces.
---------
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
The username was percent-encoded when building the SSH destination, a
leftover from when the destination was an `ssh://` URL (#25314). Since
the destination is now passed as a plain argument, the encoding turned
domain usernames like `DOMAIN\user` into `DOMAIN%5Cuser`, and
authentication failed.
Pass the username verbatim instead. So that a username beginning with
`-` can't be parsed as an option, `ssh` now receives it via `-l
<username> -- <host>` rather than a `username@host` string, and
`scp`/`sftp` (which have no username option, and forward it to `ssh` via
`-l` themselves) get `--` before their operands. Options that used to
follow the destination (`-T`, and `-t` for the Windows master process)
are moved before `--` so they aren't sent as part of the remote command.
Fixes#63709Closes#63722
Assisted-by: LLM
NOTE: This is a continuation of #63722. I chose to leave Shaik Shahid
Afridi as the primary author, because I'm just resolving the review
comments from that PR.
In responding to the review comments, we also improve SSH/SCP for
usernames starting with `-`, because we now use `-l` for SSH and `--`
for SFTP/SCP, though I'm not sure if OpenSSH would accept a username
starting with `-` anyways. Nevertheless, an improvement over what came
before.
# Objective
When attempting to connect to a remote with a backslash in the username
(or any other character that results in URL encoding), Zed would mangle
the resulting SSH command and the remote would not be usable.
## Solution
- Describe the solution used to achieve the objective above.
URL encoding in the SSH field is an artifact of when `ssh://` was used,
and is no longer needed.
## Testing
Tested by running Zed and attempting to connect to a remote with a
backslash in the user field (a Windows domain account). SSH succeeded,
but then I ran into a separate bug with `%PROCESSOR_ARCHITECTURE%` not
being expanded. I'll be looking into that in a separate PR.
```sh
2026-09-24T16:09:24-05:00 INFO [remote::transport::ssh] Remote is windows: true
2026-09-24T16:09:38-05:00 ERROR [remote::transport] $SHELL is not set, falling back to cmd.exe
2026-09-24T16:09:38-05:00 INFO [remote::transport::ssh] Remote shell discovered: cmd.exe
2026-09-24T16:09:39-05:00 ERROR [workspace::notifications] Prebuilt remote servers are not yet available for windows-%PROCESSOR_ARCHITECTURE%. See https://zed.dev/docs/remote-development
```
Tested on Linux x86_64, attempting to connect to a Windows x86_64
machine.
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments **(N/A)**
- [ ] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines) **(N/A)**
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
## Showcase
**NOTE:** I mentioned it above, but just in case it was missed, there is
a separate bug with Zed not expanding `%PROCESSOR_ARCHITECTURE%`. I'll
probably look into that next, since I'm trying to get remote development
set up for my Windows machine.
[Screencast_20260924_160804.webm](https://github.com/user-attachments/assets/ce6c77fb-eea5-4cda-944e-50539bece61d)
---
Release Notes:
- Fixed an issue where SSH usernames containing `/` or `\` were
percent-encoded, preventing successful connections.
Co-authored-by: Shaik Shahid Afridi <81465960+Yooosless@users.noreply.github.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
## Summary
Remote reconnection previously reusing the heartbeat timeout (5 secs),
and started the resync timeout before the new connection completed its
handshake. As a result, the timeout could expire before the handshake
finished.
Refactored the code to introduce separate timeouts for the handshake and
resync, with the resync timeout starting after the handshake completes.
Also moved the tests previously located in the middle of the file to the
end.
## Testing
A new integration test.
## Self-review
- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [ ] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.
Release Notes:
- Improved timeout handling for SSH reconnections
## Summary
Connecting to my server I regularly use takes about 4 seconds. Previous
implementation used 3 sequential commands to detect the remote
environment, since windows does not support multiplexing, these queries
alone could take around 12 seconds.
This change batches those queries into a single script.
## Testing
Added some unit tests for the parsing logic, although they are still
fairly example-based. I tested the changes on my own machines as well.
## Self-review
- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [ ] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.
Release Notes:
- Batch SSH environment queries
---------
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Follows-up https://github.com/zed-industries/zed/pull/64862 with similar
fixes:
* replaces a few dependencies that are almost not used, removes unused
dependencies
* removed unused features
* removes `test-support` dependencies from the regular tree
* cleans up build scripts
Despite the large diff, the changes are rather mechanical, split by
commits.
Result:
<img width="1172" height="77" alt="image"
src="https://github.com/user-attachments/assets/7d8aeb58-7cec-4246-8157-d07fc585f81f"
/>
Release Notes:
- N/A
- [GPUI] N/A
## Summary
The OS should not be re-probed during remote reconnection.
## Testing
Just a simple refactoring.
## Self-review
- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [ ] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [ ] Tests cover the new or changed behavior.
Release Notes:
- Reuse the known OS when reconnecting over SSH
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
## Summary
When running the dev version of Zed and trying to connect to a remote
server, Zed triggers a local build of `remote_server` and uploads it to
the remote. When the local host is different from the remote, Zed uses
`cargo-zigbuild` to cross-build the `remote_server` binary. When the
local host is Windows and the remote is a Unix system, it just works,
but in reverse, it does not.
The truth is, I have never been able to cross-build the Windows
`remote_server` binary on my Linux machine; it always throws an error in
the linking stage. Apart from that, even when using some dirty hacks, I
can have the binary built and uploaded, but there are still two
problems:
- the `remote_server` binary size is very big, larger than 1.0 GB
- it is very unstable, always exiting shortly after the connection.
Partly it is because we are cross-building a gnu version binary:
https://github.com/zed-industries/zed/blob/e52ab15eac51e5644da6a3c9e1fac9bb2330b000/crates/remote/src/transport.rs#L293-L307
So in the past, to test if a remote fix works, I needed to first push
the fix, ssh to the remote Windows server, pull the changes, and build
the `remote_server` directly on that Windows machine, then manually copy
the binary to the directory where Zed stores remote servers. Not a fan
of this at all anymore.
So here, instead of using `cargo-zigbuild` to cross-build the Windows
`remote_server` on Unix-like platforms, we change to `cargo-xwin`, which
is designed to cross-build the msvc version of Windows programs from
Unix-like systems. From my local test, it can do the work perfectly, and
the produced binary size is about 200 MB, the same as the binary built
directly on a Windows machine, and more importantly, it is very stable,
with no dropped connections or crashes.
I suspect there are some concerns:
1. When first running `cargo xwin`, some Windows-sdk files are
downloaded and cached.
2. If we need to use `cargo-xwin`, we need to accept the Microsoft
license: https://go.microsoft.com/fwlink/?LinkId=2086102
3. In the final linking process, there are always some warnings,
typically:
```
lld-link: Cannot use debug info for 'libcmt.lib(dyn_tls_dtor.obj)' [LNK4099]
>>> failed to load reference 'D:\a\_work\1\s\binaries\amd64ret\lib\amd64\libcmt.amd64.pdb': No such file or directory
lld-link: Cannot use debug info for 'libcmt.lib(initsect.obj)' [LNK4099]
>>> failed to load reference 'D:\a\_work\1\s\binaries\amd64ret\lib\amd64\libcmt.amd64.pdb': No such file or directory
lld-link: Cannot use debug info for 'libvcruntime.lib(softmemtag.obj)' [LNK4099]
>>> failed to load reference 'D:\a\_work\1\s\binaries\amd64ret\lib\amd64\libvcruntime.amd64.pdb': No such file or directory
```
## Testing
You can just run the following commands on a Linux or Mac machine to
test the `cargo-xwin` build of `remote_server`:
```bash
rustup target add x86_64-pc-windows-msvc
cargo install --locked cargo-xwin
cargo xwin build -p remote_server --target x86_64-pc-windows-msvc
```
## Self-review
- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [ ] Tests cover the new or changed behavior.
Release Notes:
- N/A
---------
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
I think this is the final attempt of mine to do anything about the
binary size, as those fixes become relatively intricate and I like them
less and less.
Each commit has its own improvement stats and mainly reduce generic-code
duplication through shared non-generic helpers and `#[inline(never)]`
boundaries.
Total reduction stats:
With sccache disabled, `cargo clean` and `cargo build --release -p zed`:
Before: zed binary 396716472 bytes
After: zed binary 359416504 bytes (-9.40%, -37.29MB)
Release Notes:
- N/A
---------
Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
## Summary
- Add `window_title_format` and `window_title_separator` settings for
customizing the window title
- Expose `${projectName}`, `${fileName}`, `${filePath}`,
`${relativePath}`, `${fileStem}`, `${remoteName}`, `${remoteHost}`,
`${appName}`, and `${separator}` as the native Zed window-title
variables
- Keep the collab `↗/↙` indicator hard-appended
- Translate VS Code `window.title` / `window.titleSeparator` aliases
into Zed's canonical variables during settings import, including
`${appName}` passthrough support and mapping VS Code's
`${activeEditorMedium}` onto Zed's `${relativePath}`
- Gate path-, remote-, and release-channel-derived lookups on whether
the active template references the corresponding variable, so the
default template avoids the extra work and still uses the existing
`last_window_title` cache to skip redundant platform updates
An alternative approach is at #49638. I went with `${variable}` names
over `$ZED_*`, canonical Zed variable names with VS Code aliases handled
at import time, kept `${separator}` as the only structural token, and
left `${dirty}` out of scope.
## Implementation reasoning and notes
### Variables considered but not included
- **collab/shared indicator variable**: kept hard-appended instead.
Folding it into the template would need whitespace/separator logic the
other variables don't need, and I'd rather not bake those semantics in
without a concrete need for it.
- **dirty variable**: The glyph choice and interaction with OS-level
edited indicators (like macOS's titlebar dot via `set_window_edited`)
felt like a separate design call I wasn't confident making here.
A separator-style config for each of collab/shared/dirty would solve the
above, but I didn't want to add too many additional settings initially.
### Performance
`update_window_title` is on a hot path, so two short-circuits apply:
- Path-, remote-, and release-channel-derived lookups (`absolute_path`,
relative-path string, `file_stem`, `remote_connection_options`,
`ReleaseChannel::try_global`) are gated on `template.contains(...)` via
`WindowTitleNeeds::from_template`, so the default template avoids the
extra work.
- The existing `last_window_title` cache still skips the platform call
when the rendered title is unchanged.
## Screenshots
Settings Editor entries for `window_title_format` and
`window_title_separator`:
<img width="774" height="324" alt="Settings Editor screenshot"
src="https://github.com/user-attachments/assets/b3378ec7-5649-4de3-9de6-164a42bce3fd"
/>
Customized Zed window titles in AltTab app switcher (remote, local,
empty):
<img width="774" height="324" alt="AltTab app switcher screenshot"
src="https://github.com/user-attachments/assets/a189945e-fc68-41b9-aab9-6dc04d5ef4ab"
/>
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Closes#14534
Release Notes:
- Added configurable window title formatting with `window_title_format`
/ `window_title_separator`, including `${appName}` / `${remoteName}` /
`${remoteHost}` variables and VS Code `window.title` import support
---------
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
# Objective
Fixes#63569
`run_docker_command` Debug-formatted the whole `docker exec` command, so
every `-e NAME=VALUE` pair forwarded into a dev container was written to
`Zed.log` in plaintext: once at DEBUG, and again in the error message
that `remote_client.rs` logs at ERROR on a failed reconnect.
## Solution
Render the command with `redact_arguments`, which replaces the value of
every `-e NAME=VALUE` argument with `<redacted>` before the arguments
are flattened, and pass the remaining arguments and stderr through
`util::redact::redact_command`.
Validate `containerEnv` and `remoteEnv` keys in `spawn_dev_container`
before any container is reused or built, because an empty key produced
`-e =VALUE`, which the Docker CLI rejects while echoing the value
verbatim to stderr.
Skip invalid names in `remote` as well, since `remote_env` is also
rehydrated from the workspace database.
The shared predicate lives in `util::redact::is_valid_environment_name`.
The DEBUG line now logs the redacted command and exit status only; the
previous stdout and stderr byte dumps are gone.
## Testing
`cargo test -p remote -p dev_container --lib`.
Unit tests cover redaction of forwarded env, argument boundaries,
assignments inside program arguments and stderr, invalid-name skipping
and rejection, and the podman CLI.
Release Notes:
- Fixed dev container environment variables being logged in full
---------
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
[corgi](https://github.com/ConradIrwin/corgi) is a cargo-compatible
build tool that runs `build.rs` scripts and proc-macros in a sandbox (no
network, no ambient env, reads limited to a package's own `.rs` sources
unless declared). This makes Zed buildable under it. Cargo builds (dev
and release) are unaffected.
### Changes
- **`scratch` patch**: patch `scratch` to a small local copy
(`corgi-patches/scratch`) that reads `OUT_DIR` at runtime instead of
baking it in at compile time. `cxx-build` writes its shared cxxbridge
headers into `scratch::path(...)`; upstream returns a single global dir
(outside any action's `OUT_DIR`) that the sandbox can't grant, while
this patch gives each build script a private, writable dir in its own
entry. webrtc-sys is self-contained, so per-crate scratch dirs are
sufficient. Kept local rather than a cxx git fork because a git checkout
of cxx needs symlink support that Windows cargo CI lacks.
- **Dev asset loading**: add `util::dev_fs_embed!` and switch dev-mode
`rust_embed` asset sources (`assets`, `settings`, `grammars`, `agent`,
`edit_prediction_cli`) to read from the checkout at runtime, locating
the repo root by walking from the executable up to the enclosing `.git`.
This avoids baking `CARGO_MANIFEST_DIR` into the binary (corgi rejects
artifacts that embed the build-time checkout path, and it's wrong in any
other worktree). Release builds still embed via `#[derive(RustEmbed)]`.
- **Stop baking checkout paths into artifacts**: drop
`gpui::GPUI_MANIFEST_DIR`; resolve `../gpui` from `gpui_apple`'s build
script; stage the metal shader into `OUT_DIR` before compiling so the
`.metallib` records the output dir, not the checkout; resolve the repo
root at runtime in `remote` and `inspector_ui` (removing
`inspector_ui`'s `build.rs` / `ZED_REPO_DIR`).
- **corgi.toml**: declare the pinned tools (`cmake`, prebuilt libwebrtc
via `LK_CUSTOM_WEBRTC`), a release-only `ZED_COMMIT_SHA` probe, and the
non-`.rs` / cross-package reads each package performs.
### Validation
- `corgi check` + `corgi build`, dev and release, for `zed` (plus `cli`,
`remote_server`, `ep`) with a warm C++ cache — clean; built binaries
embed no checkout path.
- `corgi fmt --check`, `corgi clippy`, and `corgi test` on the changed
crates (922 tests pass).
- `cargo check -p util` locally; relying on CI for the full cargo
build/test matrix.
### Notes for the reviewer
- Per the repo rule, the first two lines of `README.md` are the
review-confirmation marker; remove them before merging (this is what
Danger is failing on).
- `remote_server` cross-compilation (linux-musl via zigbuild) is not yet
covered by `corgi.toml` — host (macOS arm64) only for now.
### Suggested .rules additions
Only if the team wants corgi guidance in `.rules` (it recurred several
times here): dev builds must not bake the checkout path into artifacts —
no `env!("CARGO_MANIFEST_DIR")` or `file!()`-derived absolute paths in
library/binary output. Resolve the repo root at runtime via
`util::dev_repo_root()` (walks to `.git`), and use `util::dev_fs_embed!`
for dev-mode `rust_embed` sources.
Release Notes:
- N/A
---------
Co-authored-by: Ben Kunkle <ben@zed.dev>
## Objective
Fixes an issue where language servers provided by extensions are not
included in the settings schemas served by remote servers. When
connecting to a remote server via the
`open_remote_project_with_existing_connection` flow (dev servers,
multi-workspace reopen, git worktree picker), setup-N servers never
received any extension sync, so their schemas omitted extension-provided
language servers, breaking language support for remote development.
## Solution
Three changes ensure that language servers provided by extensions are
included in the settings schemas served by remote servers:
1. **Register connections opened via
`open_remote_project_with_existing_connection` with the extension
store**: dev servers, multi-workspace reopen, and the git worktree
picker now register their connections with the extension store so that
extensions are synced to those servers. Previously only the
`open_remote_project` flow did this, so setup-N servers never received
any extension sync and their schemas omitted extension language servers.
2. **Emit `ExtensionsInstalledChanged` from `HeadlessExtensionStore`
after sync and install complete**: this allows the remote process to
invalidate its cached settings schemas. The local `ExtensionStore`
already emitted this event; without it, the remote schema cache stayed
stale for the lifetime of the server process.
3. **Include available LSP adapters in the project settings schema**:
this matches the user settings schema (this was fixed for `settings` in
#46766 but never applied to `project_settings`).
## Testing
- Manually verified that after connecting to a remote server via the
`open_remote_project_with_existing_connection` flow (including dev
servers and the git worktree picker), extension language servers appear
in the schema served by the remote server.
- Verified that `ExtensionsInstalledChanged` is emitted after sync and
install complete, and that the remote schema cache is correctly
invalidated and rebuilt.
- Verified that the `project_settings` schema includes the available LSP
adapters, matching the behavior of the user settings schema.
- Reviewers should focus on the multi-workspace reopen and git worktree
picker flows (the two previously unregistered flows) to confirm that
extension language servers are correctly synced and appear in the
schema.
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
## Showcase
**Server / Project** — before the fix
<img width="1061" height="749" alt="image"
src="https://github.com/user-attachments/assets/d6c5459f-58fb-4769-a701-f6fb317adc37"
/>
**Local**
<img width="1119" height="449" alt="image"
src="https://github.com/user-attachments/assets/fb30a1e2-74f0-4439-a25f-1022ed164074"
/>
---
Release Notes:
- Fixed an issue where language servers provided by extensions were
missing from settings schemas served by remote servers.
---------
Co-authored-by: vancez <vancez@users.noreply.github.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
# Objective
Fixes#47623
- When authenticating git commands using a security key through
`askpass`. The modal which asks for user presence does not get dismissed
even after the git command finishes successfully.
## Solution
Add a cancellation task to the `AskPassModal`, which gets dropped when
the requested operation completes. This cancellation task then dismisses
the modal.
## Testing
- I've tried authentication through `askpass` using my own security key.
Testing both successful and failed authentication.
- I've added tests which confirm that the modal gets dismissed when a
task is cancelled, and that the cancellation is triggered when
`ask_password` Task gets dropped.
Willing to pair on review, message me on Slack. Showcase video left out
because it would leak private information.
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Release Notes:
- Fixed authentication prompts not dismissing automatically when using
security keys with ssh
# Objective
- Fixes#62238
- Properly escapes paths in the sftp PUT line
## Solution
- 10-line wrapper function that escapes paths as sftp expects. Namely:
paths in quotes with `\\` and `"` escaped.
## Testing
- Did you test these changes? If so, how? `cargo check`
- Are there any parts that need more testing? Up to you, this is a
simple change and I dont think sftp with default install paths ever
worked on MacOS
- How can other people (reviewers) test your changes? Is there anything
specific they need to know? Just connect to a remote on OSX and see if
the logs had an sftp upload failure in there
- If relevant, what platforms did you test these changes on, and are
there any important ones you can't test?
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
---
Release Notes:
- Fix remote uploads over sftp where the paths contain spaces
---------
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Closes#47375
The current `crates/remote/src/transport/wsl.rs` remote transport code
tries to copy the remote-server from /mnt/c/* from within WSL. This
fails if you have automount disabled, or otherwise have your drive
unmounted.
How to reproduce this error:
Prerequisites: Windows with WSL2 and a WSL distro installed.
1. Inside the WSL distro, disable Windows automount — edit
`/etc/wsl.conf`:
```ini
[automount]
enabled = false
```
2. From a Windows shell: `wsl --shutdown`
3. Open the distro shell again and confirm `mount | grep /mnt/c` returns
nothing.
4. From Zed (any version before this PR), open a remote WSL project on
that distro for the first time (no cached
`~/.zed_server/zed-remote-server-*` inside the distro — `rm` it if
present).
The solution was to pipe the server in over stdin if the copy fails.
This is a fallback path similar to how ssh.rs has a fallback path if the
download fails there.
With this PR the logs look like this:
```
2026-05-24T18:51:37-07:00 INFO [remote::transport::wsl] uploading remote server to WSL ".zed_server/download-72808-remote_server" (441187kb)
2026-05-24T18:51:37-07:00 WARN [remote::transport::wsl] failed to upload remote server via /mnt, falling back to wsl.exe stdin: Command 'Command("wsl.exe" "--distribution" "Ubuntu" "--cd" "~" "--exec" "wslpath" "-u" "C:/Users/<user>/Documents/GitHub/zed/target/remote_server/x86_64-unknown-linux-musl/debug/remote_server")' failed: wslpath: C:/Users/<user>/Documents/GitHub/zed/target/remote_server/x86_64-unknown-linux-musl/debug/remote_server: Command 'Command("wsl.exe" "--distribution" "Ubuntu" "--cd" "~" "wslpath" "-u" "C:/Users/<user>/Documents/GitHub/zed/target/remote_server/x86_64-unknown-linux-musl/debug/remote_server")' failed: wslpath: C:/Users/<user>/Documents/GitHub/zed/target/remote_server/x86_64-unknown-linux-musl/debug/remote_server
2026-05-24T18:51:38-07:00 INFO [remote::transport::wsl] uploaded remote server in 945.899ms
```
I considered making wsl just use curl/wget to download as a fallback, as
docker/ssh do, but that would lose the 'cache' effect of downloading
once on windows and sending to multiple WSL distros. Which seems to have
been the intent of the copy method in the first place.
I also considered using the network-drive style UNC mount to copy from
Windows to the WSL distro, but that could run into similar issues where
the user may have that disabled. It also seems to copy as WSL's default
user, rather than the --user specified to Zed for the distro. Currently
--user is not passed by default to wsl.exe, so that ends up being the
default user. However, it is settable through the settings.json, so some
rare users may still have an issue with ownership of the copied files.
I chose to make the new stdin option the fallback instead of the default
because the current code is working for most people, and it seemed like
a much larger change to replace the default.
For the tests there don't seem to be any tests for wsl.rs currently that
I can find, so it seemed like a lot of extra code needed to satisfy that
PR checkbox. wsl.rs and docker.rs have zero inline tests, and the ones
that are in ssh.rs don't cover the ensure/upload/download portion. The
integration tests seem to use RemoteClient::fake_server and bypass the
real transports.
For manual testing I tested these scenarios:
1. WSL distro with automount **on** AND existing binary: **still works**
2. WSL distro with automount **on** AND **no** existing binary: **still
works**
3. WSL distro with automount **off** AND existing binary: **still
works**
4. WSL distro with automount **off** AND **no** existing binary: **now
works**
I'm not all that proficient with rust so I used a coding agent to help,
but I reviewed every line and it all makes sense to me. Please let me
know if something looks off, I'm trying to learn.
Release Notes:
- Fixed remote server installation failing in WSL when automount is
disabled.
---------
Co-authored-by: Lukas Wirth <lukas@zed.dev>
All arguments passed to the initial remote connection command were
initially blindly passed to `scp` or `sftp` command line.
This is an issue with some arguments like "-X" or "-Y" that either does
not exist, or have a different semantic.
This PR introduces a denylist of arguments before crafting the command
to execute.
Reproduce steps:
1. Create a new remote connection, e.g `ssh -X user@192.168.1.1`
2. Expect the upload of the remote server to fail with a message saying
that '-X' is not a valid argument for `ssh` / `sftp` depending on your
setup.
Self-Review Checklist:
- [X] I've reviewed my own diff for quality, security, and reliability
- [X] Unsafe blocks (if any) have justifying comments
- [X] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [X] Performance impact has been considered and is acceptable
Release Notes:
- Fixed wrong arguments that may be passed to scp or sftp command when
pushing remote files.
---------
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Co-authored-by: Lukas Wirth <lukas@zed.dev>
When testing Zed on our team's Devcontainer I found some missing
features/bugs/spec mismatches. Commit messages were written by hand,
code reviewed and tested manually, but everything was written by
Claude/Codex based on:
- https://github.com/devcontainers/cli
- https://github.com/devcontainers/spec
The main use case of the metadata is that you can `devcontainer exec`
and `devcontainer up` into a container Zed started (and vice versa). The
same with VSCode, it will reuse Zed's created devcontainer correctly
now. This is useful when using LLMs so they can run commands in the same
devcontainer you have open.
Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Release Notes:
- Fixed Dev Container compatibility and lifecycle behavior.
Closes#44926Closes#43157Closes#29903
We have an askpass 17s timeout that races against Git operations and
results in "Connecting to host timed out". It came along in #25953 when
we extracted askpass out of remoting, where it was used for SSH.
I think, for SSH connection, no prompt and no connection after 17
seconds means the host is unreachable, so the timeout is a reliable
signal there. But for Git, silence is pretty normal. Cases like hook
running, pack transferring, an ssh-agent waiting on a fingerprint are
all senarios where we should not be dependent on timeout which kills
these healthy operations.
#43285 worked around this for commits by running the pre-commit hook
manually and passing `--no-verify` to `git commit`. But, there are more
problems to address, which I reproduced on my machine:
1. A slow `post-commit` hook fails, since `--no-verify` doesn't skip it.
2. A slow `pre-push` hook fails too, and a workaround like #43285 needs
a lot more handling. See
https://github.com/zed-industries/zed/pull/42946#issuecomment-3550570438.
3. This is the tough one: due to `--no-verify`, we are also skipping the
`commit-msg` hook. There is no direct way to call that hook since, Git
hands this hook its in-progress message file, commits whatever the hook
leaves in it, and aborts if the hook exits non-zero. Reproducing that
outside `git commit` means reimplementing that.
4. An ssh-agent waiting for user approval fails after the timeout, like
if you have 1Password set up.
5. It doesn't solve large fetches. Fetching
`git@github.com:torvalds/linux.git` just dies at the 17s timeout
mid-download.
This PR fix keep the timeout only on the SSH transport and drop it for
Git, which is less of a behavior change and more of a restoring its
original scope. If Git in a terminal doesn't time out, we shouldn't
either. This way, we let Git handle all types of hooks, which solves the
hooks issue along with the timeout issue. _This follows how VS Code does
it. It does not have any kind of timeout on git child process, and hooks
are handled by Git itself._
Edit: I also think working towards way to cancel long going operations
is better way forward. See
https://github.com/microsoft/vscode/issues/171353.
Hooks still don't run for untrusted repositories, the existing
`core.hooksPath=/dev/null` clamp covers that. The `RunGitHook` proto
handler is kept for compatibility with older remote clients.
Release Notes:
- Fixed git operations failing with a misleading "Connecting to host
timed out" error when they took longer than 17 seconds (large fetches,
slow hooks, or waiting on agent-based authentication like 1Password
Touch ID).
- Fixed `commit-msg` hooks being silently skipped on commit.
This is necessary to remove some `util` dependencies from crates, as
well as better sharing for our projects. This also includes the WIP
AbsPath abstraction as well as some bug fixes from internal tooling.
Release Notes:
- N/A or Added/Fixed/Improved ...
When you use `anyhow::anyhow!("{error}")` to convert a preexisting error
to an `anyhow::Error`, the error source can be lost (depending on the
`Display` impl of the error). Anyhow errors can display the whole source
chain when printed. This commit makes us consistently use `context()`
instead to preserve the underlying error's source.
Release Notes:
- N/A
# Objective
Telemetry events generated **on a remote server** were silently dropped,
and all remote telemetry that *was* reported got attributed to the local
client's OS.
## Solution
This PR makes server-originated events flow to the telemetry pipeline
and attributes them to the actual remote host (connection type, OS,
version, architecture), plus adds a transport-agnostic connection event.
## Additional Notes
This removes the "SSH Project Opened" event and replaces it with a
"Remote Connection Established" one that has more structured info and is
also more useful in where it gets invoked.
The server unconditionally sends back telemetry to the client, the
client is then responsible for filtering on whether telemetry is enabled
by the user or not as the server does not have knowledge of those
settings itself.
Release Notes:
- N/A
This fixes archive cleanup for agent threads so Zed only removes
worktrees it explicitly created, rather than treating every linked
worktree under the configured managed directory as safe to delete. When
Zed creates a worktree, it now records it in the local database along
with the creation time of the worktree's git metadata directory
(`.git/worktrees/<name>/`). Archive planning requires that record, and
right before deleting anything, Zed re-stats the directory and compares
creation times: if the worktree was removed and recreated outside Zed
(or the time can't be read at all), deletion is skipped and the stale
record is dropped. Every failure mode fails safe by leaving the
directory untouched.
For remote (SSH) projects, the stat runs on the remote host via a new
`GitWorktreeCreatedAt` request. Worktrees created by a different Zed
install (another release channel, or another machine connecting to the
same host) have no record in the local database and are therefore never
auto-archived, which is the intended conservative behavior.
Closes https://github.com/zed-industries/zed/issues/57155
Closes AI-352
Release Notes:
- Fixed archiving an agent thread incorrectly deleting manually-created
git worktrees.
On Windows, Zed generated a .ps1 askpass script and set **SSH_ASKPASS**
to 'powershell.exe -ExecutionPolicy Bypass -File ...'. SSH calls exec()
on SSH_ASKPASS which cannot exec a command string, causing:
error: ssh_askpass: exec(powershell.exe ...): No such file or directory
Fix by pointing **SSH_ASKPASS** directly to cli.exe and passing the
socket path via **ZED_ASKPASS_SOCKET** env var, which cli.exe reads
before clap parses arguments.
---
> Compiling Zed almost blew up my computer.
---
Related #29048
Release Notes:
- Fixed some ssh issues on windows that prevented from connecting to a
remote
Adds `scheduler::spawn_dedicated_thread` (and inherent `spawn_dedicated`
methods on `PlatformScheduler` and `TestScheduler`) so single-threaded
actors that own `!Send` state can run on their own OS thread and freely
do blocking I/O without disturbing any other executor.
### Why
A single-threaded actor that needs to do blocking syscalls is currently
stuck: it can't run on the shared foreground executor (blocking would
stall every other foreground session), and it can't move to the
background pool because its state isn't `Send`. `spawn_dedicated` gives
each such actor its own thread and its own `LocalExecutor`, while still
participating in the same testable scheduler infrastructure as
everything else.
### Shape
- `pub fn spawn_dedicated_thread(session_id, scheduler, f) -> Task<_>`
in `scheduler`. Owns the OS thread, the per-session runnable channel,
and the `LocalExecutor` setup.
- Inherent `spawn_dedicated` on `PlatformScheduler` (allocates its own
`SessionId`, delegates to the free function).
- Inherent `spawn_dedicated` on `TestScheduler` (no real thread — runs
as a fresh local session driven by the test scheduler's run loop, so
determinism under `many` is preserved).
- Renames `Scheduler::schedule_foreground` → `schedule_local` and
`scheduler::ForegroundExecutor` → `scheduler::LocalExecutor` to reflect
that these are session-pinned queues rather than "the main thread" (a
dedicated session runs on its own thread). GPUI's wrapper
`gpui::ForegroundExecutor` and the `foreground_executor` field/method
names are unchanged to keep blast radius small.
- `LocalExecutor::new` now takes an explicit dispatch closure, so the
routing decision (default session, dedicated thread, or something else)
lives at the construction site.
### Tests
- `TestScheduler` side: round-trip, `!Send` future, `Send` closure
capturing shared state, inner `executor.spawn`, determinism under `many`
seeds, drop-cancels-future, detached child runs after root completes.
- `PlatformScheduler` side: real separate thread (blocking syscalls
don't stall the test), `!Send` future output, drop-cancels-future,
thread tears down after work completes, detached child outlives root.
cc @as-cii
Release Notes:
- N/A
---------
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Closes #ISSUE
Release Notes:
- N/A or Added/Fixed/Improved ...
### Motivation
This is the second of three PRs to add remote/collab support for the git
graph and is a follow-up to #54468. I'm adding remote support for the
search because it's not user accessible without the initial graph fetch
having remote support, so it allows us to merge this without having to
add full remote support. Collab guest support will be added in a
follow-up PR.
#### Summary
For large repos, searching can take a while to fully stream in all
matched results. For example, running a basic search on the Linux repo
took over 10s for me. Because of that, we want to stream search results
in chunks to downstream users to keep the time-to-first-match low. After
this change, the first chunk gets sent back after ~50ms on the Linux
repo from receiving the request.
In order to accomplish that, I added a new proto client API that allows
for a request to map to n responses. e.g.
```/dev/null/example.rs#L1-1
client.add_entity_stream_request_handler(Self::handle_search_commits);
```
Note: The proto API isn't supported over collab yet, that will be
another PR
Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Closes #ISSUE
Release Notes:
- N/A
---------
Co-authored-by: cameron <cameron.studdstreet@gmail.com>
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).
## Summary
- The cross-compile path for building `remote_server` via `cargo
zigbuild` was missing `.current_dir()`, causing it to inherit the
process cwd
- This fails with "cannot specify features for packages outside of
workspace" when Zed is launched from outside its source tree
- The native build path at the same location already sets
`.current_dir()` correctly — this aligns the cross-compile path
Closes#53950
## Test plan
- [x] Build Zed from source
- [x] Launch from `/tmp`: `cd /tmp && /path/to/zed some-project
--dev-container`
- [x] Verify dev container cross-compilation succeeds
Release Notes:
- Fixed dev container cross-compilation failing when Zed is launched
from outside its source directory
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
### Summary
Follow up on: https://github.com/zed-industries/zed/pull/53550
Threads in the sidebar are now filtered by remote connection in addition
to path list. Previously, two different machines with the same absolute
project paths (e.g. both at `/home/user/project`) would have their
threads merged into a single sidebar group. Now each remote host gets
its own group.
To support this, this PR introduces `RemoteConnectionIdentity`, a
normalized subset of `RemoteConnectionOptions` that includes only the
fields relevant for identity matching (e.g. SSH host + username + port,
but not nickname or connection timeout). All remote host comparisons in
the sidebar, thread metadata store, and workspace persistence now go
through `same_remote_connection_identity()` instead of raw `==` on
`RemoteConnectionOptions`.
#### Follow Up on remoting for sidebar
1. Make the neighbor in archive thread fallback to the main git worktree
instead of the next thread
2. Start implementing remote git operations that archive feature depends
on
3. Make remote connection pool equality use `RemoteConnectionIdentity`
Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Release Notes:
- N/A
---------
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Closes #ISSUE
Release Notes:
- N/A
This PR greatly improves our handling of remote threads in the sidebar.
One primary issue was that many parts of the sidebar were only looking
at a thread's path list and not its remote connection information. The
fix here is to use `ProjectGroupKey` more consistently throughout the
sidebar which also includes remote connection information.
The second major change is to extend the MultiWorkspace with the ability
to initiate the creation of remote workspaces when needed. This involved
refactoring a lot of our remote workspace creation paths to share a
single code path for better consistency.
Release Notes:
- (Preview only) Fixed remote project threads appearing as a separate
local project in the sidebar
---------
Co-authored-by: Anthony Eid <anthony@zed.dev>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [ ] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable
Release Notes:
- N/A
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Credit to Dario Weißer for bringing this to our attention.
Self-Review Checklist:
- [ ] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable
Closes #ISSUE
Release Notes:
- Fixed a bug where a cleverly crafted directory name could lead to
remote code execution
Closes#52943
## Summary
- Prefer SSH nicknames over raw hosts in remote connection display names
- Add regression tests for nickname and host fallback behavior
## Why
The `nickname` field is documented as the user-facing label for SSH
connections, but `RemoteConnectionOptions::display_name()` always
returned the raw host. That meant recent-projects UI surfaces kept
ignoring nicknames even when they were configured.
## Validation
- `cargo test -p remote ssh_display_name`
- `cargo test -p remote`
Release Notes:
- Fixed SSH recent-project labels to show configured nicknames instead
of raw hosts when available.
This PR adds tracking of project groups to the MultiWorkspace and
serialization/restoration of them. This will later be used by the
sidebar to provide reliable reloading of threads across Zed reloads.
Release Notes:
- N/A
---------
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>