summaryrefslogtreecommitdiff
path: root/lib/functions.zsh
diff options
context:
space:
mode:
authorJames Langley <jwblangley@gmail.com>2025-06-08 09:25:23 +0100
committerGitHub <noreply@github.com>2025-06-08 10:25:23 +0200
commit788eaa5930eeafceb0cc43f338b0bacf7a2e36a8 (patch)
treee7297afb9ac145b92417e1eaf91f556bc961ee0c /lib/functions.zsh
parentac5295678f3325de1a69f9e2a603d69573112d05 (diff)
downloadzsh-788eaa5930eeafceb0cc43f338b0bacf7a2e36a8.tar.gz
zsh-788eaa5930eeafceb0cc43f338b0bacf7a2e36a8.tar.bz2
zsh-788eaa5930eeafceb0cc43f338b0bacf7a2e36a8.zip
fix(functions): escape especial chars in WSL (#13158)
Diffstat (limited to 'lib/functions.zsh')
-rw-r--r--lib/functions.zsh3
1 files changed, 3 insertions, 0 deletions
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"