# Windows: Fix canonicalize return UNC path \(\#11083\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 843d299d9a4b2a8ec97707a18ea2524c9e13118c

Requested commit: 843d299d9a4b2a8ec97707a18ea2524c9e13118c

Commit: 843d299d9a4b2a8ec97707a18ea2524c9e13118c

Tree: ce0d2022bddce5679757a5b2300d4f7eade01886

Author: CharlesChen0823

Committer: GitHub

## Message

```
Windows: Fix canonicalize return UNC path (#11083)

In Windows platform, using notify to watch file events. 
1. in [notify windows
implement](https://github.com/notify-rs/notify/blob/3df0f65152c8585cfb29d231c880b86b9164dcfd/notify/src/windows.rs#L344),
we get the full file path, just with `path.join(file_path)`.
2. In [zed worktree
start_backgroud_scan_tasks](https://github.com/zed-industries/zed/blob/d2569afe662be93c926eed1aeb2b17d050ba90b0/crates/worktree/src/worktree.rs#L679),
`abs_path` is not unc path, so we get all file events with not unc path.
3. but in [zed worktree
process_event](https://github.com/zed-industries/zed/blob/d2569afe662be93c926eed1aeb2b17d050ba90b0/crates/worktree/src/worktree.rs#L3619),
we `strip_prefix` unc path all times, it will always print annoy error.

@mikayla-maki I can't reopen pre closed pr #10501 .

Release Notes:

- N/A
```

## Parents

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

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