Skip to content

Commit

Permalink
Add esc
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanyu66 committed Dec 12, 2023
1 parent af479d5 commit cf585ac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/ui/chat_box_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ func (m ChatBoxModel) Update(msg bubbletea.Msg) (bubbletea.Model, bubbletea.Cmd)
case bubbletea.KeyCtrlC:
m.Interrupted = true
return m, bubbletea.Quit

case bubbletea.KeyEsc:
return m, bubbletea.Quit
case bubbletea.KeyCtrlS:
inputMessage := m.textarea.Value()

Expand Down Expand Up @@ -188,7 +189,7 @@ func (m ChatBoxModel) RenderChatLog() string {
}

func (m ChatBoxModel) View() string {
helpMessage := helpMessageStyle("Press Ctrl+S to send message")
helpMessage := helpMessageStyle("Press Ctrl+S to send message (esc to quit)")

if m.isLoading {
return m.viewport.View()
Expand Down

0 comments on commit cf585ac

Please sign in to comment.