# Improve cmd-click in terminal to find more paths \(\#26174\) · gitcafe/zed

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

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

Visibility: public

Requested revision: d3c68650c079917e873eb3347f7b04d0277c99dc

Requested commit: d3c68650c079917e873eb3347f7b04d0277c99dc

Commit: d3c68650c079917e873eb3347f7b04d0277c99dc

Tree: 360aeaee7595d32a0968e8d015ed394e80a77f41

Author: Kirill Bulatov

Committer: GitHub

## Message

```
Improve cmd-click in terminal to find more paths (#26174)

Closes https://github.com/zed-industries/zed/issues/25701

Reworks the way cmd-click is handled:

* first, all worktree entries are checked for existence

This allows more fine-grained lookup of entries that are in the
worktree, but their path in the terminal is not "full": in case neither
`cwd` no worktree's root + that temrinal paths form a valid path
(https://github.com/zed-industries/zed/issues/25701)

The worktrees are sorted by "the most close to cwd first" so such files
are attempted to resolved in the most specific worktree.

This also fixes no cmd-click working in the remote ssh.

* second, only if the client is local, do the FS checks to find
non-indexed files

Release Notes:

- Improved cmd-click in terminal to find more paths
```

## Parents

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

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