diff --git a/nav.go b/nav.go index 84c59cc..794ab73 100644 --- a/nav.go +++ b/nav.go @@ -320,12 +320,12 @@ func (nav *Nav) top() { } func (nav *Nav) cd(wd string) error { + wd = strings.Replace(wd, "~", envHome, -1) + if !path.IsAbs(wd) { wd = path.Join(nav.currDir().path, wd) } - wd = strings.Replace(wd, "~", envHome, -1) - err := os.Chdir(wd) if err != nil { return fmt.Errorf("cd: %s", err)