fix(zoxide/cd): support folder contains space

This commit is contained in:
verse91
2026-05-09 22:54:27 +07:00
parent 5f4a11edf0
commit 3c5a0580d1
5 changed files with 35 additions and 12 deletions
+7 -1
View File
@@ -1,6 +1,8 @@
package fs
import (
"strings"
"github.com/versenilvis/iris/commands/core"
)
@@ -8,6 +10,10 @@ func init() {
core.Register(&core.Spec{
Name: "cd",
Description: "change directory",
Generator: core.FileGenerator("/"), // Directory only
MaxArgs: 0,
Generator: func(tokens []string, prefix string, partial string) []core.Suggestion {
fullQuery := strings.Join(tokens[1:], " ")
return core.FileGenerator("/")(tokens, prefix, fullQuery)
},
})
}