delta icon indicating copy to clipboard operation
delta copied to clipboard

🚀 Hyperlink integration with vscode integrated terminal

Open Siegrift opened this issue 1 year ago • 2 comments

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 :)

Siegrift avatar Apr 18 '23 12:04 Siegrift

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

zaneduffield avatar Jan 24 '24 02:01 zaneduffield

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!

dandavison avatar Jan 24 '24 17:01 dandavison