From b99c1cc6336a24dae62c6fd2f0916d7801eac233 Mon Sep 17 00:00:00 2001 From: Balint Reczey Date: Sat, 3 Apr 2021 13:23:28 +0200 Subject: [PATCH] Revert "pager: stop disabling urlification under a pager" 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/shared/pretty-print.c b/src/shared/pretty-print.c index 137ba77b..b8aeb140 100644 --- a/src/shared/pretty-print.c +++ b/src/shared/pretty-print.c @@ -21,6 +21,10 @@ 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; -- 2.30.2