delta: 🐛 Windows Terminal Preview 1.4: Hyperlinks not working

So I was trying the Hyperlink support in Windows Terminal Preview 1.4 but it doesn’t seem to work (hyperlinks source is shown instead of actual links.)

Raw output

❯ git --no-pager show dd88342018aa239c77d7667bc988f0ff5db4610a
commit dd88342018aa239c77d7667bc988f0ff5db4610a
Author: Dan Davison <dandavison7@gmail.com>
Date:   Thu Sep 17 21:35:46 2020 -0400

    cargo fmt

diff --git a/src/tests/test_example_diffs.rs b/src/tests/test_example_diffs.rs
index ba847c2..9f1a257 100644
--- a/src/tests/test_example_diffs.rs
+++ b/src/tests/test_example_diffs.rs
@@ -819,11 +819,15 @@ src/align.rs
             "--line-numbers",
         ]);
         let output = integration_test_utils::run_delta(GIT_DIFF_SINGLE_HUNK, &config);
-        assert!(output.contains("
-@@ -71,11 +71,8 @@ impl<'a> Alignment<'a> {"));
-        assert!(!output.contains("
+        assert!(output.contains(
+            "
+@@ -71,11 +71,8 @@ impl<'a> Alignment<'a> {"
+        ));
+        assert!(!output.contains(
+            "

-@@ -71,11 +71,8 @@ impl<'a> Alignment<'a> {"));
+@@ -71,11 +71,8 @@ impl<'a> Alignment<'a> {"
+        ));
         ansi_test_utils::assert_line_has_no_color(
             &output,
             9,

Delta output

image

Other information

If I instead try the “Validation Steps Performed” snippet in https://github.com/microsoft/terminal/pull/7251#issue-466370410, it works as expected:

image

In case it helps, these are the relevant options in my .gitconfig:

[core]
	pager = delta

[delta]
	hyperlinks = true
	line-numbers = true
	line-numbers-minus-style = "#660000"
	line-numbers-zero-style = "#333333"
	line-numbers-plus-style = "#006600"
	minus-style = "#999999" "#330000"
	plus-style = "#999999" "#003300"
	minus-emph-style = "#cccccc" "#660000"
	plus-emph-style = "#cccccc" "#006600"
	syntax-theme = TwoDark

I also added this to my Microsoft.PowerShell_profile.ps1 (as per as per microsoft/terminal#7251)

$ESC = "`e"

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (13 by maintainers)

Commits related to this issue

Most upvoted comments

I just tried delta 0.4.4 and can confirm the issue is now solved! 🎉

To recap, this is what I’ve done to have delta render hyperlinks in Windows Terminal & PowerShell Core:

  1. Enable hyperlinks in delta

    git config --global delta.hyperlinks true
    
  2. Add the following to PowerShell’s $PROFILE (credit to @torarnv)

    $env:DELTA_PAGER = 'less -rFX'
    
  3. Enjoy

Note that clicking hyperlinks still doesn’t work, but that’s already tracked in microsoft/terminal#7699.

Thanks to @dandavison and @torarnv for helping out!