b5d52682cab844a5ffdc1b1f2ee80de561e0e6aa

Author
Marc Cornellà <marc@mcornella.com>
Committer
GitHub <noreply@github.com>
Date

Message

fix(dash): urlencode special parameters like `:` in query (#12811)

In macOS, using queries such as `dash php:enum` does not open Dash.app,
possibly due to colon character being interpreted as a port.

URL-encoding the parameter (: -> %3A) makes this work again.

Fixes https://discord.com/channels/642496866407284746/809850042575093760/1308076125456437300

Diff

 1diff --git a/plugins/dash/dash.plugin.zsh b/plugins/dash/dash.plugin.zsh
 2index f6801a8709ede6b8288b03ebfad8c80c4148638e..9abd691c770fe5c32ff8e64e2d8f5dac2cf147e8 100644
 3--- a/plugins/dash/dash.plugin.zsh
 4+++ b/plugins/dash/dash.plugin.zsh
 5@@ -1,5 +1,5 @@
 6 # Usage: dash [keyword:]query
 7-dash() { open -a Dash.app dash://"$*" }
 8+dash() { open -a Dash.app "dash://$(omz_urlencode -r $*)" }
 9 compdef _dash dash
10 
11 _dash() {