diff --git a/util/shell_complete.go b/util/shell_complete.go index a6e3289..2d41440 100644 --- a/util/shell_complete.go +++ b/util/shell_complete.go @@ -59,7 +59,16 @@ func ShellCompleter(line string, vt ast.VarTable, ft ast.FuncTable) []string { } } else { for _, f := range fobjs { - compSource = append(compSource, dir + "/" + f.Name()) + fileTok := f.Name() + if dir != "." { + fileTok = dir + "/" + fileTok + } + + if f.IsDir() { + fileTok = fileTok + "/" + } + + compSource = append(compSource, fileTok) } }