Skip to content

url: exclude trailing spaces from path matches - #13505

Merged
mitchellh merged 1 commit into
ghostty-org:mainfrom
ruseel:remove-trailing-space-at-eol
Jul 29, 2026
Merged

mitchellh merged 1 commit into
ghostty-org:mainfrom
ruseel:remove-trailing-space-at-eol

Conversation

@ruseel

@ruseel ruseel commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

This change improves the user experience for Pi TUI users on macOS.

As a user of Ghostty 1.3.1, Pi 0.80.7, and macOS 26.5, I noticed that
Command-click was not working.

With Pi's help (GPT-5.6 Terra High), I narrowed the cause down to Pi's redraw
behavior and src/config/url.zig's regular expression. More details are in
Vouch Request #13491.

The trailing_spaces_at_eol behavior in src/config/url.zig was introduced in
PR #9921 while improving
Command-click handling for relative and local paths. The concern about matching
trailing whitespace was also noted in a review comment.

However, supporting file paths with trailing spaces does not seem like a good
trade-off because it blocks Command-click for file paths displayed by Pi TUI.

This PR removes that behavior.

I tested this on my Mac with a patched Ghostty build, and Command-click worked
correctly for file paths in Pi TUI.

AI disclosure: I used Pi with GPT-5.6 Terra High to investigate and implement this change.
I reviewed the code and tested the result myself.

ghostty-org#13491
ghostty-org#9921

Path matching previously included end-of-line spaces. Pi redraws can
leave blank cells after a path, causing cmd-click to open a pathname
that includes those cells. Do not include trailing whitespace in path
matches.

AI disclosure: Pi using GPT-5.6 Terra High was used to investigate
and write this change. I reviewed it personally.
@mitchellh
mitchellh merged commit 6ad1fe7 into ghostty-org:main Jul 29, 2026
98 of 99 checks passed
@github-actions github-actions Bot added this to the 1.4.0 milestone Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants