zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
48.35k stars 2.88k forks source link

URLs in terminal is not clickable if link contains question mark #14500

Open gjask opened 3 months ago

gjask commented 3 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

  1. open terminal in zed on linux
  2. git push remote branch to gitlab
  3. gitlab will respond with link to create new MR which terminal doesn't allow (recognize) to be clicked

Environment

Zed: v0.143.7 (Zed) OS: Linux Wayland fedora 40 Memory: 14.9 GiB Architecture: x86_64

If applicable, add mockups / screenshots to help explain present your vision of the feature

obrazek

If applicable, attach your Zed.log file to this issue.

No response

notpeter commented 3 months ago

If you hold ctrl the link should become a hyperlink. On MacOS, cmd is the key that does this.

gjask commented 3 months ago

It still doesn't work not even with any of Ctrl keys pressed. I should have wrote that in original message, because I have also tried that.

gjask commented 3 months ago

To be completely clear, some links in terminal work for me. This one doesn't.

notpeter commented 3 months ago

I can reproduce this issue. Links which contain a question mark are no converted to hyper links.

Reproduction steps:

  1. In terminal paste echo https://www.google.com/search?q=hi and press enter
  2. Hover over the output holding ctrl (linux) or cmd (mac)
  3. No Hyperlink
bbb651 commented 2 months ago

I found the problem, the url regex is perfectly fine and matches the url as intended, but the word regex doesn't match ? and =, and for some reason the word regex is matched before the url - I went through the entire git of word_regex up to this commit that introduced it and I still cannot understand it's purpose, especially as it does not agree with alacrity about what a word is since double click word selection works with an entirely different logic (e.g. : breaks apart words, but ? and = doesn't, which makes sense as : is often used as a delimiter). There has been many commits adding more and more characters to make it this "url or path matcher". I think it should just be replaced with separate path and url matchers, or at least be renamed and be properly defined because "word" is not the right word (especially as paths can contain spaces, currently this is not handled at all).

prfj commented 1 month ago

Any feedback on this ?

This negative impacts Zed experience when working with Git push using bitbucket, gitlab and others

Example after push

remote:
remote: View pull request for feature/xxx => master:
remote:   https://bitbucket.org/project/repo/pull-requests/1?t=1
remote:

results on unclickable link

gjask commented 1 month ago

This issue seems to be wrongly labelled as a support issue. So maybe that is why it is not reaching devs.

hovsater commented 1 month ago

I can re-produce this as well, so I went ahead and updated the labels accordingly.