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
2025-10-08 15:07:29 +01:00
committed by GitHub
parent f52320be86
commit 876d4f450a
2 changed files with 32 additions and 2 deletions

View File

@@ -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