Fix opening links containing ampersands (&) in WSL

Opening links containing ampersands inside lazygit (a pull-request
creation page in BitBucket Server, for instance) returns the following
Powershell error:
> The ampersand (&) character is not allowed. The & operator is reserved
> for future use; wrap an ampersand in double quotation marks ("&") to
> pass it as part of a string.

We fix it by enclosing the URL in single quotes.
This commit is contained in:
Baptiste Ottino 2024-08-23 20:52:27 +02:00 committed by Stefan Haller
parent 4cfeb18632
commit 1543b83d10

View file

@ -22,7 +22,7 @@ func GetPlatformDefaultConfig() OSConfig {
if isWSL() && !isContainer() {
return OSConfig{
Open: `powershell.exe start explorer.exe "$(wslpath -w {{filename}})" >/dev/null`,
OpenLink: `powershell.exe start {{link}} >/dev/null`,
OpenLink: `powershell.exe start '{{link}}' >/dev/null`,
}
}