diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2016-02-03 04:46:02 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2016-02-03 04:46:02 +0900 |
commit | 30bd0b53dbf804a96db4c13d787771b3924d6634 (patch) | |
tree | 686f745afd8d0c674d19123fb9c05ab1fbfc7b0e /src | |
parent | 1893eca41a35a771d45e6074167e5488d9f2a78a (diff) |
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'
Diffstat (limited to 'src')
-rw-r--r-- | src/terminal.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/terminal.go b/src/terminal.go index bd2ad15f..181b9c06 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -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 |