mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-03 13:42:11 -07:00
Use $SHELL to start $FZF_DEFAULT_COMMAND (#481)
This commit is contained in:
@@ -5,6 +5,7 @@ import "C"
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
)
|
||||
@@ -126,3 +127,12 @@ func TrimLen(runes []rune) int {
|
||||
}
|
||||
return i - j + 1
|
||||
}
|
||||
|
||||
// ExecCommand executes the given command with $SHELL
|
||||
func ExecCommand(command string) *exec.Cmd {
|
||||
shell := os.Getenv("SHELL")
|
||||
if len(shell) == 0 {
|
||||
shell = "sh"
|
||||
}
|
||||
return exec.Command(shell, "-c", command)
|
||||
}
|
||||
|
Reference in New Issue
Block a user