Repository navigation
url: exclude trailing spaces from path matches - #13505
Merged
Merged
Conversation
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.
jcollie
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 inVouch Request #13491.
The
trailing_spaces_at_eolbehavior insrc/config/url.zigwas introduced inPR #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.