Skip to content

linux: Forward env vars starting with ZED_ to flatpak-spawn#48118

Merged
ConradIrwin merged 1 commit intozed-industries:mainfrom
refi64:wip/refi64/flatpak-env
Feb 10, 2026
Merged

linux: Forward env vars starting with ZED_ to flatpak-spawn#48118
ConradIrwin merged 1 commit intozed-industries:mainfrom
refi64:wip/refi64/flatpak-env

Conversation

@refi64
Copy link
Contributor

@refi64 refi64 commented Feb 1, 2026

Otherwise, it's not easily possible to set any of these variables when running Zed.

Release Notes:

  • Added forwarding of ZED_* environment variables when using the Flatpak

Otherwise, it's not easily possible to set *any* of these variables when
running Zed.
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 1, 2026
@zed-community-bot zed-community-bot bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Feb 1, 2026
@ConradIrwin
Copy link
Member

Thanks for this! What are the env vars you need? I'm wondering if they should just be settings to avoid breaking the assumption that flatpak gives you isolated environments.

@refi64
Copy link
Contributor Author

refi64 commented Feb 4, 2026

What are the env vars you need?

Mostly ZED_PREDICT_EDITS_URL (for obvious purpose, though I'm aware this will become a setting in the future) and sometimes ZED_STATELESS (for testing things).

I'm wondering if they should just be settings to avoid breaking the assumption that flatpak gives you isolated environments.

Note that as-is, Flatpak does not actually remove environment variables:

$ TEST=123 flatpak run --command=env dev.zed.Zed | rg TEST
TEST=123

So it's actually a bit of an abnormality that, when using flatpak-spawn here, the ZED_ vars don't get forwarded.

@ConradIrwin
Copy link
Member

That is weird... are we disabling them somewhere?

@refi64
Copy link
Contributor Author

refi64 commented Feb 5, 2026

It's not really about it being disabled..,explicitly at least. Consider that the launch flow, when not staying within the sandbox, is:

flatpak -> zed (inside sandbox) -> flatpak-spawn --host -> zed (outside sandbox)

Flatpak passes most environment variables into the sandbox, so zed (inside sandbox) gets them normally. However, flatpak-spawn works by giving the command, along with the explicitly given environment variables, to an external service that runs the outer zed. There's no normal environment inheritance at that point, and thus anything you want to forward needs to be done manually.

@ConradIrwin
Copy link
Member

ok, sorry for not figuring that out. Makes sense

@ConradIrwin ConradIrwin enabled auto-merge (squash) February 6, 2026 02:20
@ConradIrwin ConradIrwin merged commit f7a4fb1 into zed-industries:main Feb 10, 2026
49 of 53 checks passed
osiewicz added a commit that referenced this pull request Feb 10, 2026
osiewicz added a commit that referenced this pull request Feb 10, 2026
osiewicz added a commit that referenced this pull request Feb 10, 2026
- **Revert "vim: Make `:bdelete` use new
`workspace::CloseItemInAllPanes` command (#48592)"**
- **Revert "linux: Forward env vars starting with ZED_ to flatpak-spawn
(#48118)"**
- **ci: Fix builds on hel1-windows-1**


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

Release Notes:

- N/A
@osiewicz
Copy link
Member

This PR has been merged accidentally due to automerge and a screw-up from my side. Ideally we should re-land this.

morgankrey added a commit that referenced this pull request Feb 14, 2026
This is an experiment showing what the docs-suggest workflow would have
generated for the v0.224 preview release.

PRs analyzed:
- #48118: Forward ZED_ env vars to flatpak (no docs needed)
- #48467: Move update button to title bar (docs needed)
- #48553: Tool permissions refactor (docs exist, wrong format)
- #48592: vim :bdelete command (docs needed)
- #48814: Devcontainer root support (docs needed)
- #48912: Split diff default (docs needed)

5 of 6 PRs generated actionable suggestions.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
morgankrey added a commit that referenced this pull request Feb 14, 2026
This is an experiment showing what the docs-suggest workflow would have
generated for the v0.224 preview release.

PRs analyzed:
- #48118: Forward ZED_ env vars to flatpak (no docs needed)
- #48467: Move update button to title bar (docs needed)
- #48553: Tool permissions refactor (docs exist, wrong format)
- #48592: vim :bdelete command (docs needed)
- #48814: Devcontainer root support (docs needed)
- #48912: Split diff default (docs needed)

5 of 6 PRs generated actionable suggestions.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
morgankrey added a commit that referenced this pull request Feb 14, 2026
This is an experiment showing what the docs-suggest workflow would have
generated for the v0.224 preview release.

PRs analyzed:
- #48118: Forward ZED_ env vars to flatpak (no docs needed)
- #48467: Move update button to title bar (docs needed)
- #48553: Tool permissions refactor (docs exist, wrong format)
- #48592: vim :bdelete command (docs needed)
- #48814: Devcontainer root support (docs needed)
- #48912: Split diff default (docs needed)

5 of 6 PRs generated actionable suggestions.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
morgankrey added a commit that referenced this pull request Feb 14, 2026
Example output showing what the docs-suggest automation would generate
for the v0.224 preview release.

PRs analyzed:
- #48118: Forward ZED_ env vars to flatpak (no docs needed)
- #48467: Move update button to title bar (docs needed)
- #48553: Tool permissions refactor (docs exist, wrong format)
- #48592: vim :bdelete command (docs needed)
- #48814: Devcontainer root support (docs needed)
- #48912: Split diff default (docs needed)

5 of 6 PRs generated actionable suggestions.

Files:
- docs/.suggestions/v0.224-suggestions.md: Raw suggestion output
- docs/src/update.md: Update notification UI documentation
- docs/src/vim.md: Added :bdelete command
- docs/src/dev-containers.md: Root config file location support

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants