feat(history): add Atuin context scopes

This commit is contained in:
2026-08-14 13:30:10 +03:00
parent 2b82e016b9
commit e897b4a89a
13 changed files with 560 additions and 30 deletions
+11
View File
@@ -78,6 +78,11 @@ type KeybindingsConfig struct {
NavigateRight string `toml:"navigate-right"`
}
type HistoryConfig struct {
// Scope controls Atuin filtering for non-empty history searches.
Scope string `toml:"scope"`
}
type SuggestOnEmptyConfig struct {
Enabled bool `toml:"enabled"`
DebounceMS int `toml:"debounce_ms"`
@@ -125,6 +130,7 @@ type Config struct {
Core CoreConfig `toml:"core"`
UI UIConfig `toml:"ui"`
Git GitConfig `toml:"git"`
History HistoryConfig `toml:"history"`
Updater UpdaterConfig `toml:"updater"`
AI AIConfig `toml:"ai"`
Keybindings KeybindingsConfig `toml:"keybindings"`
@@ -282,6 +288,11 @@ func validate(cfg *Config) error {
return fmt.Errorf("core.shell: invalid value %q (want: bash|zsh|fish)", cfg.Core.Shell)
}
validHistoryScopes := map[string]bool{"global": true, "directory": true, "workspace": true, "hybrid": true}
if !validHistoryScopes[cfg.History.Scope] {
return fmt.Errorf("history.scope: invalid value %q (want: global|directory|workspace|hybrid)", cfg.History.Scope)
}
validChannels := map[string]bool{"stable": true, "nightly": true}
if !validChannels[cfg.Updater.Channel] {
return fmt.Errorf("updater.channel: invalid value %q (want: stable|nightly)", cfg.Updater.Channel)