tui: ^C in prompt area resets history navigation cursor (#5078)

^C resets the history navigation, similar to zsh/bash.

Fixes #4834

------
https://chatgpt.com/codex/tasks/task_i_68e9674b6ac8832c8212bff6cba75e87
This commit is contained in:
Jeremy Rose
2025-10-15 13:57:44 -07:00
committed by GitHub
parent f38ad65254
commit 0016346dfb
3 changed files with 37 additions and 1 deletions

View File

@@ -316,6 +316,11 @@ impl ChatComposer {
self.sync_file_search_popup();
}
pub(crate) fn clear_for_ctrl_c(&mut self) {
self.set_text_content(String::new());
self.history.reset_navigation();
}
/// Get the current composer text.
pub(crate) fn current_text(&self) -> String {
self.textarea.text().to_string()