diff --git a/internal/files/disk.go b/internal/files/disk.go index 633eb91..bd63e83 100644 --- a/internal/files/disk.go +++ b/internal/files/disk.go @@ -64,6 +64,7 @@ func NewDisk(path string) (DiskFile, error) { } func FindDisk(dir string, recursive bool, f *filter.Filter) (files Files, err error) { + dir = filepath.Clean(dir) if dir == "." || dir == "" { var d string if d, err = os.Getwd(); err != nil { diff --git a/internal/tables/tables.go b/internal/tables/tables.go index e4aec7f..9401093 100644 --- a/internal/tables/tables.go +++ b/internal/tables/tables.go @@ -78,11 +78,14 @@ func newModel(fs []files.File, width, height int, readonly, preselected, once bo termheight: height, mode: mode, selected: map[string]bool{}, - workdir: workdir, files: fs, } ) + if workdir != "" { + m.workdir = filepath.Clean(workdir) + } + rows := m.freshRows(preselected) columns := []table.Column{