mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
Escape special characters
This commit is contained in:
parent
2dc8396deb
commit
92f03a7872
1 changed files with 7 additions and 1 deletions
|
@ -202,7 +202,13 @@ func (c *OSCommand) ShellCommandFromString(commandStr string) *exec.Cmd {
|
|||
quotedCommand := ""
|
||||
// Windows does not seem to like quotes around the command
|
||||
if c.Platform.OS == "windows" {
|
||||
quotedCommand = strings.Replace(commandStr, "&", "^&", -1)
|
||||
quotedCommand = commandStr
|
||||
quotedCommand = strings.Replace(quotedCommand, "^", "^^", -1)
|
||||
quotedCommand = strings.Replace(quotedCommand, "&", "^&", -1)
|
||||
quotedCommand = strings.Replace(quotedCommand, "|", "^|", -1)
|
||||
quotedCommand = strings.Replace(quotedCommand, "<", "^<", -1)
|
||||
quotedCommand = strings.Replace(quotedCommand, ">", "^>", -1)
|
||||
quotedCommand = strings.Replace(quotedCommand, "%", "^%", -1)
|
||||
} else {
|
||||
quotedCommand = c.Quote(commandStr)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue