mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-06-20 09:38:05 +02:00
fix(functions): escape especial chars in WSL (#13158)
This commit is contained in:
parent
ac5295678f
commit
788eaa5930
@ -23,6 +23,9 @@ function open_command() {
|
|||||||
linux*) [[ "$(uname -r)" != *icrosoft* ]] && open_cmd='nohup xdg-open' || {
|
linux*) [[ "$(uname -r)" != *icrosoft* ]] && open_cmd='nohup xdg-open' || {
|
||||||
open_cmd='cmd.exe /c start ""'
|
open_cmd='cmd.exe /c start ""'
|
||||||
[[ -e "$1" ]] && { 1="$(wslpath -w "${1:a}")" || return 1 }
|
[[ -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 ""' ;;
|
msys*) open_cmd='start ""' ;;
|
||||||
*) echo "Platform $OSTYPE not supported"
|
*) echo "Platform $OSTYPE not supported"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user