bug: fix CLI UP/ENTER (#4944)

Clear the history cursor before checking for duplicate submissions so
sending the same message twice exits history mode. This prevents Up/Down
from staying stuck in history browsing after duplicate sends.
This commit is contained in:
jif-oai authored and GitHub committed 2025-10-08 07:07:29 -07:00
1 parent f52320be86
commit 876d4f450a
2 files changed
+32 -2

No files matched your search

@@ -59,14 +59,15 @@ impl ChatComposerHistory {
return;
}
self.history_cursor = None;
self.last_history_text = None;
// Avoid inserting a duplicate if identical to the previous entry.
if self.local_history.last().is_some_and(|prev| prev == text) {
return;
}
self.local_history.push(text.to_string());
self.history_cursor = None;
self.last_history_text = None;
}
/// Should Up/Down key presses be interpreted as history navigation given