From 788eaa5930eeafceb0cc43f338b0bacf7a2e36a8 Mon Sep 17 00:00:00 2001 From: James Langley Date: Sun, 8 Jun 2025 09:25:23 +0100 Subject: [PATCH] fix(functions): escape especial chars in WSL (#13158) --- lib/functions.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/functions.zsh b/lib/functions.zsh index b68c35c13..330b0e3e9 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -23,6 +23,9 @@ function open_command() { linux*) [[ "$(uname -r)" != *icrosoft* ]] && open_cmd='nohup xdg-open' || { open_cmd='cmd.exe /c start ""' [[ -e "$1" ]] && { 1="$(wslpath -w "${1:a}")" || return 1 } + [[ "$1" = (http|https)://* ]] && { + 1="$(echo "$1" | sed -E 's/([&|()<>^])/^\1/g')" || return 1 + } } ;; msys*) open_cmd='start ""' ;; *) echo "Platform $OSTYPE not supported"