diff options
| author | James Langley <jwblangley@gmail.com> | 2025-06-08 09:25:23 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-08 10:25:23 +0200 |
| commit | 788eaa5930eeafceb0cc43f338b0bacf7a2e36a8 (patch) | |
| tree | e7297afb9ac145b92417e1eaf91f556bc961ee0c | |
| parent | ac5295678f3325de1a69f9e2a603d69573112d05 (diff) | |
| download | zsh-788eaa5930eeafceb0cc43f338b0bacf7a2e36a8.tar.gz zsh-788eaa5930eeafceb0cc43f338b0bacf7a2e36a8.tar.bz2 zsh-788eaa5930eeafceb0cc43f338b0bacf7a2e36a8.zip | |
fix(functions): escape especial chars in WSL (#13158)
| -rw-r--r-- | lib/functions.zsh | 3 |
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" |
