zed/docs/src
Thorsten Ball fc4c533d0a
zed: Use CLI env for lang servers, tasks, terminal (#17075)
This changes the Zed CLI `zed` to pass along the environment to the Zed
project that it opens (if it opens a new one).

In projects, this CLI environment will now take precedence over any
environment that's acquired by running a login shell in a projects
folder.

The result is that `zed my/folder` now always behaves as if one would
run `zed --foreground` without any previous Zed version running.


Closes #7894
Closes #16293 

Related issues:
- It fixes the issue described in here:
https://github.com/zed-industries/zed/issues/4977#issuecomment-2305272027


Release Notes:

- Improved the Zed CLI `zed` to pass along the environment as it was on
the CLI to the opened Zed project. That environment is then used when
opening new terminals, spawning tasks, or language servers.
Specifically:
- If Zed was started via `zed my-folder`, a terminal spawned with
`workspace: new terminal` will inherit these environment variables that
existed on the CLI
- Specific language servers that allow looking up the language server
binary in the environments `$PATH` (such as `gopls`, `zls`,
`rust-analyzer` if configured, ...) will look up the language server
binary in the CLI environment too and use that environment when starting
the process.
- Language servers that are _not_ found in the CLI environment (or
configured to not be found in there), will be spawned with the CLI
environment in case that's set. That means users can do something like
`RA_LOG=info zed .` and it will be picked up the rust-analyzer that was
spawned.

Demo/explanation:



https://github.com/user-attachments/assets/455905cc-8b7c-4fc4-b98a-7e027d97cdfa
2024-08-29 18:09:06 +02:00
..
assistant docs: Update correct locations for Assistant contexts (#17049) 2024-08-28 21:24:51 -07:00
development Fix casing of "macOS" (#17040) 2024-08-28 19:10:49 -04:00
extensions Fix casing of "macOS" (#17040) 2024-08-28 19:10:49 -04:00
languages Don't use a mix of tabs and spaces (#17045) 2024-08-28 19:25:19 -04:00
additional-learning-materials.md
channels.md Docs Party 2024 (#15876) 2024-08-09 13:37:54 -04:00
code-of-conduct.md
collaboration.md Docs Party 2024 (#15876) 2024-08-09 13:37:54 -04:00
completions.md docs: update broken link (#16788) 2024-08-24 11:01:40 +03:00
configuring-languages.md docs: Link to docs for individual settings from "Configuring Languages" (#17082) 2024-08-29 08:31:49 -04:00
configuring-zed.md Don't rely on relative path for docs preprocessor (#16883) 2024-08-26 11:43:13 -04:00
contribute-to-zed.md
conversations.md Use vanity Discord link (#15880) 2024-08-06 16:55:51 -04:00
development.md Docs Party 2024 (#15876) 2024-08-09 13:37:54 -04:00
environment.md zed: Use CLI env for lang servers, tasks, terminal (#17075) 2024-08-29 18:09:06 +02:00
extensions.md docs: Add docs for defining slash commands in extensions (#16303) 2024-08-15 12:50:30 -04:00
feedback-and-support.md Docs Party 2024 (#15876) 2024-08-09 13:37:54 -04:00
fonts.md Fix casing of "macOS" (#17040) 2024-08-28 19:10:49 -04:00
getting-started.md Fix casing of "macOS" (#17040) 2024-08-28 19:10:49 -04:00
git.md Docs Party 2024 (#15876) 2024-08-09 13:37:54 -04:00
key-bindings.md Update key-bindings.md (#15994) 2024-08-13 14:40:27 +03:00
languages.md Docs Party 2024 (#15876) 2024-08-09 13:37:54 -04:00
linux.md Docs Party 2024 (#15876) 2024-08-09 13:37:54 -04:00
multibuffers.md
remote-development.md Docs Party 2024 (#15876) 2024-08-09 13:37:54 -04:00
repl.md Fix casing of "macOS" (#17040) 2024-08-28 19:10:49 -04:00
snippets.md
SUMMARY.md docs: Fix how Tailwind CSS is spelled (#16975) 2024-08-27 17:19:25 -04:00
system-requirements.md
tasks.md docs: Fix possessive "its" typos (#16516) 2024-08-20 09:59:29 -04:00
telemetry.md Don't rely on relative path for docs preprocessor (#16883) 2024-08-26 11:43:13 -04:00
themes.md Docs Party 2024 (#15876) 2024-08-09 13:37:54 -04:00
vim.md vim: Add Smart Relative Line Number (#16567) 2024-08-26 21:17:21 -06:00
windows.md Docs Party 2024 (#15876) 2024-08-09 13:37:54 -04:00