Commit graph

260 commits

Author SHA1 Message Date
Conrad Irwin
6808acce93
Fix a few cases where we weren't escaping shell vars correctly (#50562)
Release Notes:

- N/A
2026-03-02 23:31:11 -07:00
Cole Miller
db8f64935a
remote_server: Don't panic when forwarding stderr (#50505)
Closes ZED-5B7

Release Notes:

- N/A
2026-03-02 12:59:14 -05:00
Wuji Chen
7cca7bc6d6
ssh: Fix IPv6 address formatting in port forward -L arguments (#49032)
## Summary

- Fix SSH `-L` port-forward arguments to wrap IPv6 addresses in brackets
(e.g. `-L[::1]:8080:[::1]:80`), so SSH can correctly parse them
- Rewrite `parse_port_forward_spec` to support bracket-wrapped IPv6
tokens like `[::1]:8080:[::1]:80`
- Add diagnostic logging for stdin read failures in the remote server to
aid debugging connection issues

Closes #49009

## Test plan

- [x] New unit tests: `test_parse_port_forward_spec_ipv6`,
`test_port_forward_ipv6_formatting`,
`test_build_command_with_ipv6_port_forward`
- [x] Existing tests pass: `cargo test -p remote --lib
transport::ssh::tests` (6/6)
- [ ] Manual verification: connect via SSH to an IPv6 host with port
forwarding configured

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-26 08:42:56 +00:00
Filipe Azevedo
4325520064
recent_projects: Fix remote reconnect when server is not running (#49834)
Closes https://github.com/zed-industries/zed/issues/49363

When an existing remote workspace's connection is dead (e.g. the server
died and reconnect failed, leaving the client in `ServerNotRunning`
state), `remote_connection()` returns `None`. Previously this caused an
error dialog, blocking reconnection — the user had to manually switch to
another project and back to recover.

Now the code falls through to establish a fresh connection instead,
matching the previous behavior where clicking "Reconnect" would just
work.

Release Notes:

- Fixed remote reconnect failing with an error when the server is not
running, now establishes a fresh connection instead.
2026-02-23 12:39:56 +01:00
Lukas Wirth
be6f27cb8e
remote: Fix wsl interop detection failing on some setups (#49708)
Closes https://github.com/zed-industries/zed/issues/49697

Release Notes:

- Fixed interop detection on WSL not working on newer setups
2026-02-20 12:51:49 +01:00
MostlyK
ae9bb6a628
repl: Add WSL and SSH remote kernel support (#47891)
Closes #15196, #46918 

- fix: notebook_ui, use buffer so that notebooks open in remote/WSL
settings.
- fix: add musl in nix for cross-compilation, without this remote server
doesn't build inside NixOS


Release Notes:

- Implement WSL and SSH remote kernels (crates/repl/src/kernels/*) and
wire up spawn/kill kernel proto messages and client requests.
2026-02-20 09:36:21 +00:00
Lukas Wirth
7d80412cca
Reduce amount of monomorphizations from FnMut closures (#49453)
Replaces a bunch of `impl FnMut` parameters with `&mut dyn FnMut` for
functions where this is the sole generic parameter.
Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-02-18 12:00:02 +01:00
John Tur
d168301c5d
Reuse existing remote workspaces when opening files from the CLI (#49307)
Re-lands https://github.com/zed-industries/zed/pull/48891, which was
reverted due to conflicts with multi-workspace.

Before you mark this PR as ready for review, make sure that you have:
- [X] Added a solid test coverage and/or screenshots from doing manual
testing
- [X] Done a self-review taking into account security and performance
aspects

Release Notes:

- N/A
2026-02-16 18:03:18 -05:00
Jakub Konka
16dfc60ad2
util: Always use posix_spawn on macOS even with pre_exec hooks (#49090)
Here's some backstory:
* on macOS, @cole-miller and I noticed that since roughly Oct 2025, due
to some changes to latest macOS Tahoe, for any spawned child process we
needed to reset Mach exception ports
(https://github.com/zed-industries/zed/issues/36754 +
6e8f2d2ebe)
* the changes in that PR achieve that via `pre_exec` hook on
`std::process::Command` which then abandons `posix_spawn` syscall for
`fork` + `execve` dance on macOS (we tracked it down in Rust's std
implementation)
* as it turns out, `fork` + `execve` is pretty expensive on macOS
(apparently way more so than on other OSes like Linux) and `fork` takes
a process-wide lock on the allocator which is bad
* however, since we wanna reset exception ports on the child, the only
official way supported by Rust's std is to use `pre_exec` hook
* posix_spawn on macOS exposes this tho via a macOS specific extension
to that syscall `posix_spawnattr_setexceptionports_np` but there is no
way to use that via any standard interfaces in `std::process::Command`
* thus, it seemed like a good idea to instead create our own custom
Command wrapper that on non-macOS hosts is a zero-cost wrapper of
`smol::process::Command`, while on macOS we reimplement the minimum to
achieve `smol::process::Command`  with `posix_spawn` under-the-hood

Notably, this changeset improves git-blame in very large repos
significantly.

Release Notes:

- Fixed performance spawning child processes on macOS by always forcing
`posix_spawn` no matter what.

---------

Co-authored-by: Cole Miller <cole@zed.dev>
2026-02-13 20:16:11 +01:00
Mikayla Maki
83de8a25e0
Revert PRs for landing in main (#48969)
We're going to re-apply these after landing the multiworkspace branch.

Release Notes:

- N/A
2026-02-12 00:28:17 +00:00
John Tur
d2c922b815
Reuse existing windows when opening files in remote workspaces (#48891)
Closes https://github.com/zed-industries/zed/issues/42366

- [ ] Tests or screenshots needed?
- [X] Code Reviewed
- [X] Manual QA

Release Notes:

- Opening files with the Zed CLI will reuse existing windows for remote
workspaces.
2026-02-10 17:48:54 -05:00
Andres Suarez
99f80d7693
remote: Fix build_remote_server_from_source compression on unix (#48319)
When using gzip, the output path's extension becomes `.gz`.

Release Notes:

- N/A
2026-02-04 09:15:21 +00:00
KyleBarton
85d03d5122
Use remote user from devcontainer CLI and respect shell in passwd (#48230)
Closes #46252

Uses the `remoteUser` property returned from the devcontainer CLI so
that settings are respected. Additionally, checks for a default shell in
`passwd` if `$SHELL` is not set.

Release Notes:

- Fixed remote_user and shell inconsistencies from within dev containers
2026-02-02 16:43:51 -08:00
localcc
fa0db76811
Fix SSH reconnection message (#48190)
Closes #34531

Release Notes:

- N/A
2026-02-02 16:41:35 +00:00
andreasp
782f91f320
Fix launching from WSL with fish as default shell (#48136)
Closes #46801

When connecting to WSL2 with fish as the default shell, Zed gets stuck
at "Starting proxy". The connection works fine when bash is the default
shell.

In `start_proxy()`, the WSL command was being invoked with:

```rust
let proxy_process = match wsl_command_impl(&self.connection_options, "env", &proxy_args, false)
```

Changing the last argument to true invokes the WSL command with `--exec`
flag which executes the command in the WSL environment without spawning
a new shell.

With above fix I can launch Zed from WSL (Arch) with fish.
2026-02-02 08:11:22 +00:00
Joseph T. Lyons
72b151e3aa
Revert "Allow always_allow patterns for Nushell, Elvish, and Rc shells" (#48050)
Reverts zed-industries/zed#47908

This PR inadvertently caused a regression:

- https://github.com/zed-industries/zed/issues/48047
2026-01-30 21:26:13 +00:00
Richard Feldman
b7e11b38f4
Allow always_allow patterns for Nushell, Elvish, and Rc shells (#47908)
## Summary

This PR extends the `always_allow` tool permission patterns to work with
Nushell, Elvish, and Rc shells. Previously, these shells were
incorrectly excluded because they don't use `&&`/`||` operators for
command chaining. However, brush-parser can safely parse their command
syntax since they all use `;` for sequential execution.

## Changes

- Add `ShellKind::Nushell`, `ShellKind::Elvish`, and `ShellKind::Rc` to
`supports_posix_chaining()`
- Split `ShellKind::Unknown` into `ShellKind::UnknownWindows` and
`ShellKind::UnknownUnix` to preserve platform-specific fallback behavior
while still denying `always_allow` patterns for unrecognized shells
- Add comprehensive tests for the new shell support
- Clarify documentation about shell compatibility

## Shell Notes

- **Nushell**: Uses `;` for sequential execution. The `and`/`or`
keywords are boolean operators on values, not command chaining.
- **Elvish**: Uses `;` to separate pipelines. Does not have `&&` or `||`
operators. Its `and`/`or` are special commands operating on values.
- **Rc (Plan 9)**: Uses `;` for sequential execution and `|` for piping.
Does not have `&&`/`||` operators.

## Security

Unknown shells still return `false` from `supports_posix_chaining()`, so
`always_allow` patterns are denied for safety when we can't verify the
shell's syntax.

(No release notes because granular tool permissions are still
feature-flagged.)

Release Notes:

- N/A

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-01-29 06:08:05 +00:00
Lukas Wirth
9bfb900caa
remote_server: Cleanup old server binaries on wsl (#47839)
Closes https://github.com/zed-industries/zed/issues/44736

Release Notes:

- Fixed remote server binaries accumulating on wsl over time
2026-01-28 13:30:43 +01:00
Lukas Wirth
9622179798
agent_servers: Inherit codex api key environment vars for remote (#47850)
Closes https://github.com/zed-industries/zed/issues/46786

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-01-28 12:29:44 +00:00
John Tur
17d34db366
Fix issues with Windows SSH support (#47822)
- Remove the newlines in the unzip command string, which made it not
work.
- Fix spawning the terminal and tasks. Unfortunately, the Windows
OpenSSH server has limitations that require rather ugly workarounds.

Release Notes:

- N/A
2026-01-28 02:37:26 +00:00
John Tur
18bc26866e
Fix extraction of Windows remote server (#47690)
Release Notes:

- N/A
2026-01-26 20:51:13 +00:00
John Tur
e49dd8ba37
Fix Zed not entering disconnected state when remote proxy dies (#47659)
When I kill the remote proxy, it seems like `ssh` exits with code -1.
Since that's less than or equal to 0, this means we don't try to restart
the connection. The proxy really shouldn't exit for any reason, so let's
get rid of this check altogether.

Release Notes:

- N/A

Co-authored-by: Lukas Wirth <me@lukaswirth.dev>
2026-01-26 15:23:35 +00:00
Lukas Wirth
9e183d94ee
project: Do not send UpdateProject message on remote server spawn (#47633)
The client has not yet setup its own side of things so the message will
always error as being unhandled anyways.

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-01-26 09:21:12 +00:00
John Tur
9931c6f944
Add SSH remote server for Windows (#47460)
Closes https://github.com/zed-industries/zed/issues/33748

Release Notes:

- Windows is now supported as a target platform for SSH remoting.

---------

Co-authored-by: Lukas Wirth <me@lukaswirth.dev>
2026-01-24 13:15:01 -05:00
Piotr Osiewicz
515a840e76
build: Bump Rust version to 1.93 (#47358)
Release Notes:

- N/A

---------

Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
2026-01-23 13:22:41 +01:00
Lukas Wirth
b082481a7a
project_panel: Show Reveal in File Manager on wsl (#47288)
Assimilates https://github.com/zed-industries/zed/pull/46856 and adds
support for reveal file manager in the project panel on wsl. Closes
https://github.com/zed-industries/zed/pull/46856

Release Notes:

- Fixed "Reveal in File Manager" not working for WSL remote connections
on Windows.
- Show "Reveal in File Manager" in the project panel context menu on WSL

---------

Co-authored-by: Max Malkin <maxim_malkin@outlook.com>
2026-01-22 11:24:23 +00:00
Lukas Wirth
164e37e41d
remote: Bring back docker exit status mapping (#47206)
cc https://github.com/zed-industries/zed/pull/45584, was removed in
#47200 fully due to breaking ssh
Also makes ZED_BUILD_REMOTE_SERVER a bit easier to use

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-01-20 11:26:40 +00:00
Lukas Wirth
8d555271ac
remote: Fix connecting to remote with running server failing (#47203)
Follow up to https://github.com/zed-industries/zed/pull/47200, fixing an
edge case where if the heartbeat failure disconnects us we get stuck in
an unconnectable state

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-01-20 11:12:16 +00:00
Lukas Wirth
02a19f7a74
remote: Fix being unable to reconnect when the remote server dies (#47200)
Closes https://github.com/zed-industries/zed/issues/38522

Release Notes:

- Fixed remote connections getting stuck in limbo when the server side
dies unexpectedly
2026-01-20 10:44:29 +00:00
KyleBarton
6acca17c44
Devcontainer setup modal (#47021)
Adds the ability to create a dev container definition from scratch.
Additionally, separates devcontainer logic out into its own crate, since
it was getting sufficiently complex to separate from the
`recent_projects` crate.

A screen recording of the modal experience:


https://github.com/user-attachments/assets/f6cf95e1-eb7b-4ca3-86c7-c1cbc26ca557


Release Notes:

- Added modal to initialize a dev container definition in the project
with `projects: initialize dev container`
- Added podman support for dev container actions with the `use_podman`
setting
- Improved devcontainer error handling

---------

Co-authored-by: Sam Coward <idoru42@gmail.com>
2026-01-16 15:20:48 -08:00
Lukas Wirth
c2f49c9e0a
remote_server: Fix panic handler not logging useful info (#46975)
Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-01-16 12:26:33 +00:00
Ben Kunkle
a2728e39a8
Split settings content into its own crate (#46845)
Closes #ISSUE

Moves the settings content definitions into their own crate, so that
they are compiled+cached separately from settings, primarily to avoid
recompiles due to changes in gpui. In that vain many gpui types such as
font weight/features, and `SharedString` were replaced in the content
crate, either with `*Content` types for font/modifier things, or
`String`/`Arc<str>` for `SharedString`. To make the conversions easy a
new trait method in the settings crate named `IntoGpui::into_gpui`
allows for `into()` like conversions to the gpui types in
`from_settings` impls.

Release Notes:

- N/A

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2026-01-15 18:10:21 +00:00
Lukas Wirth
3d0222a5af
remote: Support opening builtin host files in remote workspaces on wsl (#46910)
Release Notes:

- Opening bundled files, keymap, and local release notes now opens in
remote windows instead of opening a new local zed window
- Opening the settings files, keymap files, task files, debug files and
logs will now open within wsl windows instead of opening a new local zed
window
2026-01-15 15:21:57 +00:00
Lukas Wirth
f1fd0ab529
remote: Fix not being able to cancel in connecting state (#46789)
Release Notes:

- Fixed being unable to cancel remote connections while still connecting
to the remote server
2026-01-14 11:49:21 +00:00
Lukas Wirth
2127b8d758
remote: Fix ACP agents not working in docker (#46778)
Closes https://github.com/zed-industries/zed/issues/45165

Release Notes:

- Fixed external agents not working in docker remotes
2026-01-14 09:41:03 +00:00
Conrad Irwin
4aa3cd07c3
Revert "Revert scheduler update (#46659)" (#46671)
Reland the new scheduler

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-01-14 07:19:13 +00:00
Lukas Wirth
4e368d485c
remote: Add remote timeout debugging commands (#46695)
Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-01-13 13:39:07 +00:00
Lukas Wirth
5deb4aa085
remote: Pass -q on ssh remotes when running one shot commands (#46458)
This pollutes tasks and similar with a `connection closed` message
otherwise.

Release Notes:

- Fixed terminal tool for agents ending with `connection closed` on
remote hosts polluting context
2026-01-09 15:58:29 +00:00
Piotr Osiewicz
b55046319d
remote: Add build-remote-server-binary for use in benchmarks (#46451)
Benchmarks that depend on remote server would not rebuild the remote
server binary outside of dev builds. Let dependants of remote opt into
building the binary even in release builds.

Release Notes:

- N/A
2026-01-09 15:36:40 +01:00
Lukas Wirth
aaebee488f
Add recent_projects remote test (#46436)
Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-01-09 12:45:10 +00:00
Lukas Wirth
f053aeb4dd
remote: Introduce a proper mock remote connection (#46337)
Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-01-08 12:13:57 +00:00
Mikayla Maki
97c35c084b
gpui: Actually remove the Result from AsyncApp (#45809)
Depends on: https://github.com/zed-industries/zed/pull/45768

Refactor plan:
https://gist.github.com/mikayla-maki/6c4bf263fd80050715ba01f45478796e
Overall plan:
https://gist.github.com/mikayla-maki/7bb5078e4385a2e683e1e1eb40d17d38

This is the big one.

Release Notes:

- N/A

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 12:48:24 -08:00
Lukas Wirth
87fe1af318
remote: Fix naming inconsistencies (#46146)
Renames a bunch of ssh things to remote when its actually about remotes
in general

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-01-06 10:07:10 +00:00
Kirill Bulatov
251033f88f
Fix the argument order when starting devcontainers (#45584)
Release Notes:

- (Preview only) Fix devcontainers not starting when certain env
variables were set

Co-authored-by: KyleBarton <kjb@initialcapacity.io>
2025-12-23 19:10:51 +00:00
feeiyu
ea34cc5324
Fix terminal doesn't switch to project directory when opening remote project on Windows (#45328)
Closes #45253

Release Notes:

- Fixed terminal doesn't switch to project directory when opening remote
project on Windows
2025-12-19 17:06:16 +01:00
Lukas Wirth
f5ba029313
remote: Implement client side connection support for windows remotes (#45084)
Obviously this doesn't do too much without having an actual windows
server binary for the remote side, but it does at least improve the
error message as right now we will complain about `uname` not being a
valid powershell command.

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2025-12-17 11:31:18 +01:00
Marco Mihai Condrache
280864e7f2
remote: Support IPv6 when using SSH (#43591)
Closes #33650

Release Notes:

- Added support for remote connections over IPv6

---------

Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>
2025-12-17 08:59:27 +01:00
Marco Mihai Condrache
6401ac0725
remote: Add ssh timeout setting (#44823)
Closes #21527

Release Notes:

- Added a setting to specify the ssh connection timeout

---------

Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>
2025-12-15 17:29:33 +01:00
Lukas Wirth
e03fa114a7
remote: Remove unnecessary and incorrect single quote in MasterProcess (#44697)
Closes https://github.com/zed-industries/zed/issues/43992

Release Notes:

- Fixed remoting not working on some linux and mac systems
2025-12-12 11:53:15 +00:00
KyleBarton
3a84ec38ac
Introduce MVP Dev Containers support (#44442)
Partially addresses #11473 

MVP of dev containers with the following capabilities:

- If in a project with `.devcontainer/devcontainer.json`, a pop-up
notification will ask if you want to open the project in a dev
container. This can be dismissed:
<img width="1478" height="1191" alt="Screenshot 2025-12-08 at 3 15
23 PM"
src="https://github.com/user-attachments/assets/ec2e20d6-28ec-4495-8f23-4c1d48a9ce78"
/>
- Similarly, if a `devcontainer.json` file is in the project, you can
open a devcontainer (or go the devcontainer.json file for further
editing) via the `open remote` modal:


https://github.com/user-attachments/assets/61f2fdaa-2808-4efc-994c-7b444a92c0b1

*Limitations*

This is a first release, and comes with some limitations:
- Zed extensions are not managed in `devcontainer.json` yet. They will
need to be installed either on host or in the container. Host +
Container sync their extensions, so there is not currently a concept of
what is installed in the container vs what is installed on host: they
come from the same list of manifests
- This implementation uses the [devcontainer
CLI](https://github.com/devcontainers/cli) for its control plane. Hence,
it does not yet support the `forwardPorts` directive. A single port can
be opened with `appPort`. See reference in docs
[here](https://github.com/devcontainers/cli/tree/main/example-usage#how-the-tool-examples-work)
- Editing devcontainer.json does not automatically cause the dev
container to be rebuilt. So if you add features, change images, etc, you
will need to `docker kill` the existing dev container before proceeding.
- Currently takes a hard dependency on `docker` being available in the
user's `PATH`.


Release Notes:

- Added ability to Open a project in a DevContainer, provided a
`.devcontainer/devcontainer.json` is present

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
2025-12-10 12:10:43 -08:00