clean path before changing directory
This commit is contained in:
parent
7fe72c188f
commit
d66eb7349d
1
nav.go
1
nav.go
@ -326,6 +326,7 @@ func (nav *Nav) top() {
|
||||
|
||||
func (nav *Nav) cd(wd string) error {
|
||||
wd = strings.Replace(wd, "~", envHome, -1)
|
||||
wd = filepath.Clean(wd)
|
||||
|
||||
if !filepath.IsAbs(wd) {
|
||||
wd = filepath.Join(nav.currDir().path, wd)
|
||||
|
1
ui.go
1
ui.go
@ -476,6 +476,7 @@ func (ui *UI) draw(nav *Nav) {
|
||||
dir := nav.currDir()
|
||||
|
||||
path := strings.Replace(dir.path, envHome, "~", -1)
|
||||
path = filepath.Clean(path)
|
||||
|
||||
ui.pwdwin.printf(0, 0, termbox.AttrBold|termbox.ColorGreen, bg, "%s@%s", envUser, envHost)
|
||||
ui.pwdwin.printf(len(envUser)+len(envHost)+1, 0, fg, bg, ":")
|
||||
|
Loading…
Reference in New Issue
Block a user