correctly escape backslashes in wsh setbg. fixes windows paths #1604 (#1636)

This commit is contained in:
Mike Sawka 2024-12-27 09:37:44 -08:00 committed by GitHub
parent 0c9f35791d
commit 9521e1d51b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 {