From a4391aeedd4fec1865d2d646711f58d04058531b Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 27 Apr 2024 18:36:37 +0900 Subject: Add --with-shell for shelling out with different command and flags (#3746) Close #3732 --- src/terminal_unix.go | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'src/terminal_unix.go') diff --git a/src/terminal_unix.go b/src/terminal_unix.go index c7fa7f12..d0b00f2f 100644 --- a/src/terminal_unix.go +++ b/src/terminal_unix.go @@ -5,26 +5,11 @@ package fzf import ( "os" "os/signal" - "strings" "syscall" "golang.org/x/sys/unix" ) -var escaper *strings.Replacer - -func init() { - tokens := strings.Split(os.Getenv("SHELL"), "/") - if tokens[len(tokens)-1] == "fish" { - // https://fishshell.com/docs/current/language.html#quotes - // > The only meaningful escape sequences in single quotes are \', which - // > escapes a single quote and \\, which escapes the backslash symbol. - escaper = strings.NewReplacer("\\", "\\\\", "'", "\\'") - } else { - escaper = strings.NewReplacer("'", "'\\''") - } -} - func notifyOnResize(resizeChan chan<- os.Signal) { signal.Notify(resizeChan, syscall.SIGWINCH) } @@ -41,7 +26,3 @@ func notifyStop(p *os.Process) { func notifyOnCont(resizeChan chan<- os.Signal) { signal.Notify(resizeChan, syscall.SIGCONT) } - -func quoteEntry(entry string) string { - return "'" + escaper.Replace(entry) + "'" -} -- cgit v1.2.3