From 9521e1d51bce27721ccbbef5907c3ffa53d7660d Mon Sep 17 00:00:00 2001 From: Mike Sawka Date: Fri, 27 Dec 2024 09:37:44 -0800 Subject: [PATCH] correctly escape backslashes in wsh setbg. fixes windows paths #1604 (#1636) --- cmd/wsh/cmd/wshcmd-setbg.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/wsh/cmd/wshcmd-setbg.go b/cmd/wsh/cmd/wshcmd-setbg.go index b40e2fcf8..58c7aad59 100644 --- a/cmd/wsh/cmd/wshcmd-setbg.go +++ b/cmd/wsh/cmd/wshcmd-setbg.go @@ -140,7 +140,8 @@ func setBgRun(cmd *cobra.Command, args []string) (rtnErr error) { } // Create URL-safe path - escapedPath := strings.ReplaceAll(absPath, "'", "\\'") + escapedPath := strings.ReplaceAll(absPath, "\\", "\\\\") + escapedPath = strings.ReplaceAll(escapedPath, "'", "\\'") bgStyle = fmt.Sprintf("url('%s')", escapedPath) switch {