fix(cd): harden zoxide directory suggestions

This commit is contained in:
2026-08-14 13:11:21 +03:00
parent 0b2221d5e9
commit 11fad73ef5
12 changed files with 436 additions and 136 deletions
+2 -5
View File
@@ -13,11 +13,8 @@ func init() {
Description: "change directory",
MaxArgs: 0,
Generator: func(tokens []string, prefix string, partial string) []spec.Suggestion {
// The file generator only reads the current directory, so `cd proj`
// comes back empty unless its parent is where you already are --
// which is not how cd is typically used. zoxide.extend-cd folds in
// the frecency database that `z` already queries, making any
// directory zoxide has seen reachable by name from anywhere.
// Extend cd with zoxide's frecency database while keeping local
// filesystem suggestions first.
if config.Get().Zoxide.ExtendCd {
return ZoxideGenerator()(tokens, prefix, partial)
}