diff options
Diffstat (limited to 'dot-oh-my-zsh/custom/plugins/fzf/src/terminal_windows.go')
| m--------- | dot-oh-my-zsh | 0 | ||||
| -rw-r--r-- | dot-oh-my-zsh/custom/plugins/fzf/src/terminal_windows.go | 45 |
2 files changed, 0 insertions, 45 deletions
diff --git a/dot-oh-my-zsh b/dot-oh-my-zsh new file mode 160000 +Subproject 6fe84bf5c82da7b1f6d7c5ec3e5c447721ac8ce diff --git a/dot-oh-my-zsh/custom/plugins/fzf/src/terminal_windows.go b/dot-oh-my-zsh/custom/plugins/fzf/src/terminal_windows.go deleted file mode 100644 index a1ea7a22..00000000 --- a/dot-oh-my-zsh/custom/plugins/fzf/src/terminal_windows.go +++ /dev/null @@ -1,45 +0,0 @@ -//go:build windows - -package fzf - -import ( - "os" - "regexp" - "strings" -) - -func notifyOnResize(resizeChan chan<- os.Signal) { - // TODO -} - -func notifyStop(p *os.Process) { - // NOOP -} - -func notifyOnCont(resizeChan chan<- os.Signal) { - // NOOP -} - -func quoteEntry(entry string) string { - shell := os.Getenv("SHELL") - if len(shell) == 0 { - shell = "cmd" - } - - if strings.Contains(shell, "cmd") { - // backslash escaping is done here for applications - // (see ripgrep test case in terminal_test.go#TestWindowsCommands) - escaped := strings.Replace(entry, `\`, `\\`, -1) - escaped = `"` + strings.Replace(escaped, `"`, `\"`, -1) + `"` - // caret is the escape character for cmd shell - r, _ := regexp.Compile(`[&|<>()@^%!"]`) - return r.ReplaceAllStringFunc(escaped, func(match string) string { - return "^" + match - }) - } else if strings.Contains(shell, "pwsh") || strings.Contains(shell, "powershell") { - escaped := strings.Replace(entry, `"`, `\"`, -1) - return "'" + strings.Replace(escaped, "'", "''", -1) + "'" - } else { - return "'" + strings.Replace(entry, "'", "'\\''", -1) + "'" - } -} |
