diff options
Diffstat (limited to 'src/constants.go')
| -rw-r--r-- | src/constants.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/constants.go b/src/constants.go index 941fdcc4..06889903 100644 --- a/src/constants.go +++ b/src/constants.go @@ -1,6 +1,7 @@ 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 |
