add executable completion on windows

This commit is contained in:
Gokcehan committed 2018-06-29 00:12:54 +03:00
1 parent fef99c1d70
commit e1b6d38386
3 files changed
+22 -2

No files matched your search

+15
View File
@@ -16,6 +16,10 @@ var (
envShell = os.Getenv("SHELL")
)
var (
envPathExt = os.Getenv("PATHEXT")
)
var (
gDefaultShell = "cmd"
gDefaultSocketProt = "tcp"
@@ -109,3 +113,14 @@ func moveCursor(y, x int) {
// TODO: implement
return
}
func isExecutable(f os.FileInfo) bool {
exts := strings.Split(envPathExt, string(filepath.ListSeparator))
for _, e := range exts {
if strings.HasSuffix(strings.ToLower(f.Name()), strings.ToLower(e)) {
log.Print(f.Name(), e)
return true
}
}
return false
}