dandavison / delta

A syntax-highlighting pager for git, diff, grep, and blame output
https://dandavison.github.io/delta/
MIT License
22.98k stars 382 forks source link

🚀 Hyperlink integration with vscode integrated terminal #1397

Open Siegrift opened 1 year ago

Siegrift commented 1 year ago

Hi, thanks for this amazing library! :)

I have recently started using VS Code integrated terminal instead of iterm2. I've been using the following configuration to open files from git diff. I really enjoyed that delta created links for the line numbers and I could click those to open the file on the specific line... However, this doesn't work with the integrated terminal anymore.

I think vscode overrides the terminal behaviour with its link matcher algorithm and opens the search (and populates the search field with the number I clicked).

(This is what happens with the integrated terminal after I cmd+click number "184")

image

(Doing the same from iterm2 works as expected and the correct file is opened and correct line is selected in the vscode)

image

I don't think this is a bug in delta, but maybe someone has an answer to this - but I wasn't able to figure this out :)

zaneduffield commented 8 months ago

Reported on the vscode repo: https://github.com/microsoft/vscode/issues/176812

dandavison commented 8 months ago

Thanks for pointing this out @zaneduffield. I'm a heavy VSCode user myself nowadays, and I've actually just recently started running git blame and ripgrep ... | delta in the VSCode integrated terminal, so I certainly hope this situation improves! At minimum it seems that we want a way for VSCode to open paths in VSCode (sounds reasonable...) from terminal hyperlinks, even if we don't have arbitrary protocol support.

I hadn't noticed this because I have a personal project that uses a HTTP server to open paths in VSCode but, I was just on the verge of getting annoyed by how inelegant it was in the case of links clicked in the VSCode terminal itself, and so I was just on the verge of getting frustrated by the issue you've linked to!