Revert "pager: stop disabling urlification under a pager"
authorBalint Reczey <balint.reczey@canonical.com>
Sat, 3 Apr 2021 11:23:28 +0000 (13:23 +0200)
committerMichael Biebl <biebl@debian.org>
Fri, 19 Nov 2021 20:11:45 +0000 (20:11 +0000)
Debian and Ubuntu does not yet have a less version that supports urlification
https://github.com/systemd/systemd/issues/18814

This patch can be dropped when less 563 or later enters the archive

This reverts commit ebef02dd8f35f8b6ee58060b71b7f321a5027760.

Gbp-Pq: Topic debian
Gbp-Pq: Name Revert-pager-stop-disabling-urlification-under-a-pager.patch

src/shared/pretty-print.c

index 137ba77b3a6ea700396cce26608e02f230ee7734..b8aeb14011fe6b058cf3b921e3a44f882c4aba23 100644 (file)
 bool urlify_enabled(void) {
         static int cached_urlify_enabled = -1;
 
+        /* Unfortunately 'less' doesn't support links like this yet ðŸ˜­, hence let's disable this as long as there's a
+         * pager in effect. Let's drop this check as soon as less got fixed a and enough time passed so that it's safe
+         * to assume that a link-enabled 'less' version has hit most installations. */
+
         if (cached_urlify_enabled < 0) {
                 int val;
 
@@ -28,7 +32,7 @@ bool urlify_enabled(void) {
                 if (val >= 0)
                         cached_urlify_enabled = val;
                 else
-                        cached_urlify_enabled = colors_enabled();
+                        cached_urlify_enabled = colors_enabled() && !pager_have();
         }
 
         return cached_urlify_enabled;