mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-10 09:02:01 -07:00
Fix #481 - Use $SHELL instead of sh in execute action
Note that $SHELL only points to the default shell instead of the current shell. If you're on a non-default shell, you might want to override the value like follows. SHELL=zsh fzf --bind 'enter:execute:echo $ZSH_VERSION; sleep 1'
This commit is contained in:
@@ -720,7 +720,11 @@ func quoteEntry(entry string) string {
|
||||
|
||||
func executeCommand(template string, replacement string) {
|
||||
command := strings.Replace(template, "{}", replacement, -1)
|
||||
cmd := exec.Command("sh", "-c", command)
|
||||
shell := os.Getenv("SHELL")
|
||||
if len(shell) == 0 {
|
||||
shell = "sh"
|
||||
}
|
||||
cmd := exec.Command(shell, "-c", command)
|
||||
cmd.Stdin = os.Stdin
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
|
Reference in New Issue
Block a user