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
+1 -11
View File
@@ -79,17 +79,7 @@ type KeybindingsConfig struct {
}
type ZoxideConfig struct {
// ExtendCd adds zoxide's frecency database to `cd` completions.
//
// Without it `cd` only offers direct children of the current directory,
// because that is all the file generator walks -- so `cd proj` finds
// nothing unless you are already standing in the parent. With it, any
// directory zoxide has seen is reachable by name from anywhere, which is
// what `cd` is usually wanted for.
//
// Off by default: it shells out to zoxide, and the suggestions are absolute
// paths from outside the current directory, which is a real change in what
// `cd` offers.
// ExtendCd adds zoxide's frecency database to cd completions.
ExtendCd bool `toml:"extend-cd"`
}
+3
View File
@@ -30,6 +30,9 @@ func TestDefaultConfigAndState(t *testing.T) {
if !cfg.Core.CobraProbeEnabled {
t.Errorf("expected cobra probing to be enabled by default")
}
if cfg.Zoxide.ExtendCd {
t.Errorf("expected zoxide cd extension to be disabled by default")
}
// test manual provider registration
cfg.AI.Provider = "custom"