Zed Improved. Aiming to improve upon Zed and make a truly delightful code editor.
https://zed.dev
![]() Closes #18908 This PR started as a cleanup of redundant logic for setting up envs when Zed is launched as a desktop entry on Linux. More on this can be read [here](https://github.com/zed-industries/zed/pull/22335#issuecomment-2574726377). The TLDR is that desktop entries on Linux sometimes might not have the correct envs (as they don't `cwd` into your project directory). To address this, we initially tried to fix it by loading the default shell and its env vars. However, a better solution, as recommended by @mrnugget, is to pass `env` as `None`. Internally, if `env` is `None`, it falls back to the project's working dir envs. This removes the need to manually load the envs and is cleaner. Additionally, it also fixes an issue with Zed not loading project-specific envs because now we are actually doing so (albeit unintentionally?). I don't have macOS to test, but I believe this is not an issue on macOS since it uses the Zed binary instead of the CLI, which essentially sets the CLI `env` to `None` automatically. Before: Here, I have `/home/tims/go/bin` set up in `.envrc`, which only loads in that project directory. When launching Zed via the CLI in the project directory, notice `/home/tims/go/bin` is in the `PATH`. As a result, we use the user-installed `gopls` server. ```sh [INFO] attempting to start language server "gopls", path: "/home/tims/temp/go-proj", id: 1 [INFO] using project environment variables from CLI. PATH="/home/tims/go/bin:/usr/local/go/bin" [INFO] found user-installed language server for gopls. path: "/home/tims/go/bin/gopls", arguments: ["-mode=stdio"] [INFO] starting language server process. binary path: "/home/tims/go/bin/gopls", working directory: "/home/tims/temp/go-proj", args: ["-mode=stdio"] ``` However, when using the desktop entry and attempting to load envs from the default shell, notice `/home/tims/go/bin` is no longer there since it's not in the project directory. Zed cannot find the user-installed language server and starts downloading its own `gopls`. ```sh [INFO] attempting to start language server "gopls", path: "/home/tims/temp/go-proj", id: 1 [INFO] using project environment variables from CLI. PATH="/usr/local/go/bin" [INFO] fetching latest version of language server "gopls" [INFO] downloading language server "gopls" [INFO] starting language server process. binary path: "/home/tims/.local/share/zed/languages/gopls/gopls_0.17.1_go_1.23.4", working directory: "/home/tims/temp/go-proj", args: ["-mode=stdio"] ``` After: When using the desktop entry, we pass the CLI env as `None`. For the language server, it falls back to the project directory envs. Result, Zed finds the user-installed language server. ```sh [INFO] attempting to start language server "gopls", path: "/home/tims/temp/go-proj", id: 1 [INFO] using project environment variables shell launched in "/home/tims/temp/go-proj". PATH="/home/tims/go/bin:/usr/local/go/bin" [INFO] found user-installed language server for gopls. path: "/home/tims/go/bin/gopls", arguments: ["-mode=stdio"] [INFO] starting language server process. binary path: "/home/tims/go/bin/gopls", working directory: "/home/tims/temp/go-proj", args: ["-mode=stdio"] ``` Release Notes: - Fixed issue with project-specific env not being found via .envrc (direnv) on Linux |
||
---|---|---|
.cargo | ||
.cloudflare | ||
.config | ||
.github | ||
.zed | ||
assets | ||
crates | ||
docs | ||
extensions | ||
legal | ||
nix | ||
script | ||
tooling/xtask | ||
.git-blame-ignore-revs | ||
.gitattributes | ||
.gitignore | ||
.mailmap | ||
Cargo.lock | ||
Cargo.toml | ||
clippy.toml | ||
CODE_OF_CONDUCT.md | ||
compose.yml | ||
CONTRIBUTING.md | ||
Cross.toml | ||
debug.plist | ||
default.nix | ||
docker-compose.sql | ||
Dockerfile-collab | ||
Dockerfile-collab.dockerignore | ||
Dockerfile-cross | ||
Dockerfile-cross.dockerignore | ||
Dockerfile-distros | ||
Dockerfile-distros.dockerignore | ||
flake.lock | ||
flake.nix | ||
LICENSE-AGPL | ||
LICENSE-APACHE | ||
LICENSE-GPL | ||
livekit.yaml | ||
Procfile | ||
Procfile.postgrest | ||
README.md | ||
renovate.json | ||
rust-toolchain.toml | ||
shell.nix | ||
typos.toml |
Zed
Welcome to Zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Installation
On macOS and Linux you can download Zed directly or install Zed via your local package manager.
Other platforms are not yet available:
- Windows (tracking issue)
- Web (tracking issue)
Developing Zed
- Building Zed for macOS
- Building Zed for Linux
- Building Zed for Windows
- Running Collaboration Locally
Contributing
See CONTRIBUTING.md for ways you can contribute to Zed.
Also... we're hiring! Check out our jobs page for open roles.
Licensing
License information for third party dependencies must be correctly provided for CI to pass.
We use cargo-about
to automatically comply with open source licenses. If CI is failing, check the following:
- Is it showing a
no license specified
error for a crate you've created? If so, addpublish = false
under[package]
in your crate's Cargo.toml. - Is the error
failed to satisfy license requirements
for a dependency? If so, first determine what license the project has and whether this system is sufficient to comply with this license's requirements. If you're unsure, ask a lawyer. Once you've verified that this system is acceptable add the license's SPDX identifier to theaccepted
array inscript/licenses/zed-licenses.toml
. - Is
cargo-about
unable to find the license for a dependency? If so, add a clarification field at the end ofscript/licenses/zed-licenses.toml
, as specified in the cargo-about book.