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
This commit is contained in:
Kirill Bulatov 2025-03-06 02:41:13 +02:00 committed by GitHub
parent 43339c6869
commit d3c68650c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 210 additions and 173 deletions

1
Cargo.lock generated
View file

@ -13610,6 +13610,7 @@ dependencies = [
"gpui",
"itertools 0.14.0",
"language",
"log",
"project",
"rand 0.8.5",
"schemars",