Skip to content
This repository was archived by the owner on Mar 1, 2025. It is now read-only.

Commit db7c574

Browse files
committed
wslview: fix opening links with brackets
curl treats brackets as special glob characters, but powershell does not have that same behavior so it should be better to turn off curl globbing.
1 parent c772490 commit db7c574

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/wslview.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function add_reg_alt {
2525
}
2626

2727
function url_validator {
28-
content=$(curl --head --silent "$*" | head -n 1)
28+
content=$(curl --head --silent -g "$*" | head -n 1)
2929
if [ -n "$content" ]; then
3030
return 0
3131
else

tests/wslview.bats

+5
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,8 @@ setup() {
9595
run out/wslview "https://wslutiliti.es/"
9696
[ "$status" -eq 0 ]
9797
}
98+
99+
@test "wslview - Internet - with brackets" {
100+
run out/wslview "https://www.duckduckgo.com/?q=[wslu]"
101+
[ "$status" -eq 0 ]
102+
}

0 commit comments

Comments
 (0)