# settings: Fix incorrect worktree root for symlinked settings.json on Windows \(\#51453\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 20724716ec1ea6b8f5be0d18ed027aad7890328c

Requested commit: 20724716ec1ea6b8f5be0d18ed027aad7890328c

Commit: 20724716ec1ea6b8f5be0d18ed027aad7890328c

Tree: 9bd4fac27ee54a874a923a2ebeacc51ad1e9cb24

Author: Bryan Pothon

Committer: GitHub

## Message

````
settings: Fix incorrect worktree root for symlinked settings.json on Windows (#51453)

Closes #47007 

After #50974, symlinked `settings.json` can be opened and saved, but the
worktree ends up rooted at the file itself rather than its parent
directory, which causes this error to be logged when changing settings
via the settings GUI:

```
2026-03-18T22:24:05+01:00 ERROR [worktree] ignoring event
"C:\\Users\\Bryan\\dev\\bryanpth\\dotfiles\\config\\zed\\settings.json~RF1ab7ae0.TMP" outside of root path
"C:\\Users\\Bryan\\dev\\bryanpth\\dotfiles\\config\\zed\\settings.json"
```

Fixed by canonicalizing the symlink path before passing to `open_paths`.
Tested with a symlinked settings.json, both directly and through WSL.

Release Notes:
- Fixed incorrect worktree root when settings.json is a symlink on
Windows
````

## Parents

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

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