delta icon indicating copy to clipboard operation
delta copied to clipboard

🐛 Delta hyperlinks do not render correctly in Wezterm

Open protiumx opened this issue 7 months ago • 2 comments

I'm a long time user of wezterm and delta. I recently enabled hyperlinks in delta and they do not render correctly in the terminal, even though Wezterm supports OSC8, see https://wezterm.org/recipes/hyperlinks.html.

When using delta with git or just as a diffing tool, any file/commit link doesn't render correctly (see image).

My gitconfig

[core]
  pager = delta
[delta]
  navigate = true
  dark = true
  side-by-side = true
  hyperlinks = true
  hyperlinks-file-link-format="file://{path}#{line}"

Test command

delta <(echo "file:///test.json#118") <(echo "file:///test.txt")

Image

protiumx avatar Jun 14 '25 21:06 protiumx

Output of cat -A

delta <(echo "file:///test.json#118") <(echo "file:///test.txt") | cat -A
␊
␛[34m\u{394}·␛]8;;file:///home/brian/.dotfiles/proc/self/fd/11#␛\proc/self/fd/11␛]8;;␛\·\u{27f6}···␛]8;;file:///home/brian/.dotfiles/proc/self/fd/21#␛\proc/self/fd/21␛]8;;␛\␛[0m␊
␛[34m\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}␛[0m␊
␊
␛[34m\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}␛[0m␛[34m\u{2510}␛[0m␊
␛[34m\u{2022}␛[0m·␛]8;;file:///home/brian/.dotfiles/proc/self/fd/21#1␛\␛[34m1␛[0m␛]8;;␛\:·␛[34m\u{2502}␛[0m␊
␛[34m\u{2500}\u{2500}\u{2500}\u{2500}\u{2500}␛[0m␛[34m\u{2518}␛[0m␊
␛[34m\u{2502}␛[38;5;88m··1·␛[34m\u{2502}␛[48;2;63;0;1;38;2;248;248;242mfile:///test.␛[48;2;144;16;17mjson#118␛[0m␛[48;2;63;0;1m·············␛[0m␛[34m\u{2502}␛[38;5;28m␛]8;;file:///home/brian/.dotfiles/proc/self/fd/21#1␛\··1·␛]8;;␛\␛[34m\u{2502}␛[48;2;0;40;0;38;2;248;248;242mfile:///test.␛[48;2;0;96;0mtxt␛[0m␛[48;2;0;40;0m··················␛[0m␊

protiumx avatar Jun 14 '25 21:06 protiumx

It works fine for me

Image I had the same issue years ago. I believe it was caused by LESS env var exported by .bashrc (or .profile):

export LESS=-R

I changed it to export LESS=-r. However it is not recommended by less man page:

USE OF THE -r OPTION IS NOT RECOMMENDED.

xardas94 avatar Jun 17 '25 05:06 xardas94