Files
ghostty/src
Ben Kircher 6c0a17cccf Fix clicking bare relative file paths
Related to #1972

The URL regex for file path detection requires paths to start with
`../`, `./`, or `/`. For bare relative paths like
`"src/config/url.zig"`, the regex could only match starting at the first
`/`, producing `"/config/url.zig"` as a result — always dropping the
first part of the path.

Fix: added a third top-level alternative to the regex. This matches bare
relative paths where:

1. The first component is word characters (possibly with dots/dashes):
   `[\w][\w\-.]*\/`
2. The remaining path must contain a dot (via positive lookahead) — this
   requires a file extension to avoid false positives on text like
   input/output
3. Add a `(?<!\w)\/` instead of `\/` in the existing prefix group — the
   standalone `/` prefix now requires that `/` is not preceded by a word
   character. This prevents `"input/output"` from falsely matching
   `"/output"`

Test cases added:
- src/config/url.zig → matches fully
- app/folder/file.rb:1 → matches with line number
- modified:   src/config/url.zig → matches only the path part
- lib/ghostty/terminal.zig:42:10 → matches with line:col
- some-pkg/src/file.txt more text → stops before trailing text
- input/output and foo/bar → correctly do not match (no file extension)

The issue was nailed down here:
https://github.com/ghostty-org/ghostty/issues/1972#issuecomment-3845717672
2026-02-04 15:17:46 +01:00
..
2025-10-03 07:10:43 -07:00
2025-11-27 13:37:53 -08:00
2026-01-09 20:37:58 -08:00
2025-11-27 13:37:53 -08:00
2025-10-03 18:52:26 +02:00
2025-10-03 07:10:43 -07:00
2026-02-01 14:32:37 -08:00
2025-11-27 13:37:53 -08:00
2025-11-27 13:37:53 -08:00
2025-10-03 07:10:43 -07:00
2025-10-03 07:10:43 -07:00
2026-01-08 10:22:56 -08:00
2025-11-24 19:55:27 -08:00
2025-11-27 13:37:53 -08:00
2025-11-27 13:37:53 -08:00
2024-08-16 14:35:10 -07:00
2025-07-09 15:06:24 -07:00
2022-08-18 11:42:32 -07:00
2025-10-03 07:10:43 -07:00
2026-01-31 09:06:07 -08:00
2025-11-27 13:37:53 -08:00