# Gate sandboxed terminal tempdir to local projects \(\#58240\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/513e2b2ee3d59373bbafc5995119088d3ea2d368)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 513e2b2ee3d59373bbafc5995119088d3ea2d368

Requested commit: 513e2b2ee3d59373bbafc5995119088d3ea2d368

Commit: 513e2b2ee3d59373bbafc5995119088d3ea2d368

Tree: 4536a59fbc9e2531ba5604304eed7f633bc0f4c4

Author: Richard Feldman

Committer: GitHub

## Message

```
Gate sandboxed terminal tempdir to local projects (#58240)

[PR #57878](https://github.com/zed-industries/zed/pull/57878) introduced
a per-thread sandboxing temp directory that, for every terminal command,
overrode `TMPDIR`/`TMP`/`TEMP` and pushed the directory into the sandbox
writable scope. For remote projects this temp directory is created on
the client while the terminal actually runs on the remote host, so it
leaked client-side environment variables into the remote terminal and
pointed `$TMPDIR` at a path that doesn't exist there.

This gates the temp-directory logic behind `project.is_local()`, so
remote projects no longer get their terminal environment infected. This
doesn't restore the per-thread tempdir behavior for remoting, but it
undoes the regression.

Closes AI-348

Release Notes:

- Fixed remote terminals having their environment overridden by
client-side temp directory variables
```

## Parents

- [7e6e731bce1fdeceed10285e45314afc8b68a092](https://git.cafe/gitcafe/zed/commit/7e6e731bce1fdeceed10285e45314afc8b68a092?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/513e2b2ee3d59373bbafc5995119088d3ea2d368?format=markdown)
