Skip to content

terminal: Sanitize URLs with characters that cannot be last#43559

Merged
probably-neb merged 7 commits intozed-industries:mainfrom
marcocondrache:fix/terminal-url-sanitization
Dec 16, 2025
Merged

terminal: Sanitize URLs with characters that cannot be last#43559
probably-neb merged 7 commits intozed-industries:mainfrom
marcocondrache:fix/terminal-url-sanitization

Conversation

@marcocondrache
Copy link
Contributor

@marcocondrache marcocondrache commented Nov 26, 2025

Closes #43345

The list of characters comes from the linkify crate, which is already used for URL detection in the editor:

https://github.com/robinst/linkify/blob/5239e12e26c633f42323e51ed81b0ff534528077/src/url.rs#L228

Release Notes:

  • Improved url links detection in terminals.

Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 26, 2025
@github-actions github-actions bot added the community champion Issues filed by our amazing community champions! 🫶 label Nov 26, 2025
Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>
@marcocondrache marcocondrache marked this pull request as ready for review November 26, 2025 15:28
Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>
Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>
@marcocondrache
Copy link
Contributor Author

This fix also addresses cases like 'https://test.com/(((' that were not previously covered

@maxdeviant maxdeviant changed the title terminal: Sanitize urls with chars that cannot be last terminal: Sanitize URLs with characters that cannot be last Nov 26, 2025
Copy link
Collaborator

@probably-neb probably-neb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! Thanks for taking the time to work on this!

I think we should make this PR a bit more focused to the issue it's closing, rather than hoping that the additional stripped characters works out fine. I'd rather get an issue report saying "you didn't strip enough" than "you stripped too much and changed the meaning of the url", because the first case is more obviously wrong

@probably-neb probably-neb moved this from Community Champion PRs to In progress in Quality Week – December 2025 Dec 15, 2025
Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>
Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>
Copy link
Collaborator

@probably-neb probably-neb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Is this ready to merge?

@marcocondrache
Copy link
Contributor Author

marcocondrache commented Dec 15, 2025

@probably-neb thanks, it's ready to be merged!

@probably-neb probably-neb merged commit b17b097 into zed-industries:main Dec 16, 2025
23 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in Quality Week – December 2025 Dec 16, 2025
CherryWorm pushed a commit to CherryWorm/zed that referenced this pull request Dec 16, 2025
…stries#43559)

Closes zed-industries#43345

The list of characters comes from the linkify crate, which is already
used for URL detection in the editor:


https://github.com/robinst/linkify/blob/5239e12e26c633f42323e51ed81b0ff534528077/src/url.rs#L228

Release Notes:

- Improved url links detection in terminals.

---------

Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement community champion Issues filed by our amazing community champions! 🫶

Projects

Development

Successfully merging this pull request may close these issues.

Terminal link identification captures too much

2 participants