diff --git a/app.go b/app.go index b59e9e7..c3d1ded 100644 --- a/app.go +++ b/app.go @@ -137,7 +137,14 @@ func (app *app) loop() { if gSelect != "" { go func() { - app.ui.exprChan <- &callExpr{"select", []string{gSelect}, 1} + stat, err := os.Stat(gSelect) + if err != nil { + app.ui.exprChan <- &callExpr{"echoerr", []string{err.Error()}, 1} + } else if stat.IsDir() { + app.ui.exprChan <- &callExpr{"cd", []string{gSelect}, 1} + } else { + app.ui.exprChan <- &callExpr{"select", []string{gSelect}, 1} + } }() }