From 76b8c810aa572ad1bef3c9d821b61f4140118f77 Mon Sep 17 00:00:00 2001 From: Herobs Date: Mon, 1 Mar 2021 11:30:59 +0800 Subject: [PATCH] osx module mand fix > The {query} has to be percent-escaped in macOS 11. Just replace `:` to `%3A` work fine. But add function like this one I find on stackoverflow to encode the entire query string would be more robust. ```bash urldecode() { # urldecode local url_encoded="${1//+/ }" printf '%b' "${url_encoded//%/\\x}" } ``` --- modules/osx/functions/mand | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/osx/functions/mand b/modules/osx/functions/mand index 2902c76..b62fab3 100644 --- a/modules/osx/functions/mand +++ b/modules/osx/functions/mand @@ -8,7 +8,7 @@ function mand { if (( $# > 0 )); then zstyle -s ':prezto:module:osx:man' dash-keyword 'dashkw' || dashkw='manpages' - open "dash://$dashkw:$1" 2> /dev/null + open "dash://$dashkw%3A$1" 2> /dev/null if (( $? != 0 )); then print "$0: Dash is not installed" >&2 break