mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-05 01:46:46 +01:00
fix(functions): escape especial chars in WSL (#13158)
This commit is contained in:
parent
ac5295678f
commit
788eaa5930
1 changed files with 3 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue