mirror of
https://github.com/openai/codex.git
synced 2026-11-05 16:29:31 +00:00
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:
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
|
||||
|
||||
Reference in new issue
Block a user