From c85dfb6a369ea1e9fc4b1f4cd7dba2b9d7b75483 Mon Sep 17 00:00:00 2001 From: bptato Date: Sun, 10 Dec 2023 17:48:27 +0100 Subject: mailcap: add $MAILCAP_URL This is better than %u as it is backwards compatible (i.e. does not rely on other user agents doing whatever upon encountering an unknown substitution template.) --- src/local/pager.nim | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/local/pager.nim') diff --git a/src/local/pager.nim b/src/local/pager.nim index 388c5448..6977a4eb 100644 --- a/src/local/pager.nim +++ b/src/local/pager.nim @@ -1122,6 +1122,7 @@ proc checkMailcap(pager: Pager, container: Container): (EmptyPromise, bool) = tempfile var canpipe = true let cmd = unquoteCommand(entry.cmd, contentType, outpath, url, cs, canpipe) + putEnv("MAILCAP_URL", $url) if {COPIOUSOUTPUT, HTMLOUTPUT} * entry.flags == {}: # no output. if canpipe: @@ -1133,6 +1134,7 @@ proc checkMailcap(pager: Pager, container: Container): (EmptyPromise, bool) = return pager.runMailcapReadPipe(container, entry[], cmd) else: return pager.runMailcapReadFile(container, entry[], cmd, outpath) + delEnv("MAILCAP_URL") return (nil, true) proc handleEvent0(pager: Pager, container: Container, event: ContainerEvent): bool = -- cgit 1.4.1-2-gfad0