Skip to content

Commit 698d362

Browse files
cpcloudcursoragent
andcommitted
fix(ui): use tea.Quit for ctrl+q to return exit code 0
ctrl+q is an intentional quit action and should return success (exit code 0). Changed from tea.Interrupt (non-zero exit) to tea.Quit. tea.Interrupt should be reserved for actual error conditions or unhandled panics, not user-initiated graceful exits. Also applies to regular 'q' in nav mode which already used tea.Quit correctly. Closes #173 Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent daee821 commit 698d362

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/app/chat.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ func (m *Model) handleChatKey(key tea.KeyMsg) (tea.Model, tea.Cmd) {
10771077
m.deactivateCompleter()
10781078
return m, nil
10791079
case "ctrl+q":
1080-
return m, tea.Interrupt
1080+
return m, tea.Quit
10811081
}
10821082
}
10831083

internal/app/model.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
145145
case tea.KeyMsg:
146146
if typed.String() == "ctrl+q" {
147147
m.cancelChatOperations()
148-
return m, tea.Interrupt
148+
return m, tea.Quit
149149
}
150150
if typed.String() == "ctrl+c" {
151151
// Cancel any ongoing LLM operations but don't quit.

0 commit comments

Comments
 (0)