diff --git a/internal/tui/components/chat/editor/editor.go b/internal/tui/components/chat/editor/editor.go index 6c2766b85077c08b45efc049fdb73f7973a767c0..37d7ec1704734ef99962b735008c7bb28997e9f8 100644 --- a/internal/tui/components/chat/editor/editor.go +++ b/internal/tui/components/chat/editor/editor.go @@ -321,6 +321,8 @@ func (m *editorCmp) Update(msg tea.Msg) (util.Model, tea.Cmd) { case key.Matches(msg, m.keyMap.Next): return m, util.CmdHandler(ScrollHistoryDown{}) } + // if any key other than history related controls we play it safe and close + // the history and reset the text input field to be the current value cmds = append(cmds, util.CmdHandler(CloseHistoryMsg{ valueToSet: m.textarea.Value(), }))