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
+4 -4
View File
@@ -49,18 +49,18 @@ func MergeResults(query string, mode string) []spec.Suggestion {
if mode == "history" {
aliases := spec.GetAliasesCopy()
histResults, _ := integration.SearchHistory(query, aliases)
histResults, _ := integration.SearchHistoryIn(query, aliases, spec.GetCWD())
// scale confidence based on recency (index in histResults) so the most recent commands stay on top
baseConf := 75
for i, h := range histResults {
conf := max(baseConf-(i*2), 60)
icon := "history"
if h.Source == "atuin" {
icon = "atuin"
}
addSuggestion(spec.Suggestion{
Cmd: h.Cmd,
Desc: h.Source,
@@ -97,7 +97,7 @@ func MergeResults(query string, mode string) []spec.Suggestion {
if len(tokens) > 0 {
rootCmd = tokens[0]
}
ctxTimeout, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond)
defer cancel()
store, _ := scoring.GetFrecencyStore()