From 1543b83d10406066801f34a5192335e6a0dc89c4 Mon Sep 17 00:00:00 2001 From: Baptiste Ottino Date: Fri, 23 Aug 2024 20:52:27 +0200 Subject: [PATCH] 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. --- pkg/config/config_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/config_linux.go b/pkg/config/config_linux.go index a4c61df4f..aa3793901 100644 --- a/pkg/config/config_linux.go +++ b/pkg/config/config_linux.go @@ -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`, } }