mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-20 19:06:22 +00:00
fix: deduplicate prompt history entries
Avoid adding duplicate entries to prompt history when the same input is appended multiple times (e.g., clearing with ctrl+c then restoring via history navigation and clearing again).
This commit is contained in:
@@ -82,6 +82,7 @@ export const { use: usePromptHistory, provider: PromptHistoryProvider } = create
|
||||
return store.history.at(store.index)
|
||||
},
|
||||
append(item: PromptInfo) {
|
||||
if (store.history.at(-1)?.input === item.input) return
|
||||
const entry = clone(item)
|
||||
let trimmed = false
|
||||
setStore(
|
||||
|
||||
Reference in New Issue
Block a user