Commit 3cd051a
terminal: Normalize path-like targets with leading
Fixes zed-industries#28339
## What
- Normalize cwd-relative path-like targets that include leading `..`
before worktree lookup.
- Update issue zed-industries#28339 tests to expect `WorktreeExact` for local and
remote resolution.
## Why
- Prevent terminal links like `../foo/bar.txt` from creating invalid
entries; resolve to the correct worktree file instead.
## How to test
- `cargo test -p terminal_view issue_28339 -- --nocapture`
- Manual: open a workspace, run `echo ../foo/bar.txt` from a subdir in
the terminal, then cmd/ctrl-click and confirm the correct file opens.
## Risk
- Low: only changes terminal path-like resolution for `..` paths;
expected to match normalized behavior.
## Checklist
- [x] Tests run (`cargo test -p terminal_view issue_28339 --
--nocapture`)
- [x] Docs updated (not needed)
- [x] Backwards compatibility considered
Release Notes:
- Fixed an issue where relative paths starting with `..` would not resolve correctly when clicking the link in the terminal
---------
Co-authored-by: Ben Kunkle <ben.kunkle@gmail.com>.. (zed-industries#47289)1 parent b50de99 commit 3cd051a
1 file changed
+28
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
234 | 251 | | |
235 | | - | |
236 | 252 | | |
237 | 253 | | |
238 | 254 | | |
| |||
999 | 1015 | | |
1000 | 1016 | | |
1001 | 1017 | | |
1002 | | - | |
1003 | | - | |
1004 | 1018 | | |
1005 | 1019 | | |
1006 | 1020 | | |
| |||
1051 | 1065 | | |
1052 | 1066 | | |
1053 | 1067 | | |
1054 | | - | |
| 1068 | + | |
1055 | 1069 | | |
1056 | 1070 | | |
1057 | 1071 | | |
1058 | 1072 | | |
1059 | 1073 | | |
1060 | 1074 | | |
1061 | | - | |
1062 | | - | |
1063 | 1075 | | |
1064 | | - | |
1065 | 1076 | | |
1066 | 1077 | | |
1067 | 1078 | | |
| |||
0 commit comments