Skip to content
Snippets Groups Projects
Unverified Commit bf0cb4bf authored by Junegunn Choi's avatar Junegunn Choi
Browse files

Use find as the default command on Cygwin environment

parent 773133c4
No related branches found
No related tags found
No related merge requests found
package fzf
import (
"os"
"time"
"github.com/junegunn/fzf/src/util"
......@@ -47,6 +48,18 @@ const (
defaultJumpLabels string = "asdfghjklqwertyuiopzxcvbnm1234567890ASDFGHJKLQWERTYUIOPZXCVBNM`~;:,<.>/?'\"!@#$%^&*()[{]}-_=+"
)
var defaultCommand string
func init() {
if !util.IsWindows() {
defaultCommand = `command find -L . -mindepth 1 \( -path '*/\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \) -prune -o -type f -print -o -type l -print 2> /dev/null | cut -b3-`
} else if os.Getenv("TERM") == "cygwin" {
defaultCommand = `sh -c "command find -L . -mindepth 1 -path '*/\.*' -prune -o -type f -print -o -type l -print 2> /dev/null | cut -b3-"`
} else {
defaultCommand = `dir /s/b`
}
}
// fzf events
const (
EvtReadNew util.EventType = iota
......
// +build !windows
package fzf
const (
// Reader
defaultCommand = `command find -L . -mindepth 1 \( -path '*/\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \) -prune -o -type f -print -o -type l -print 2> /dev/null | cut -b3-`
)
// +build windows
package fzf
const (
// Reader
defaultCommand = `dir /s/b`
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment