Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions pkg/tui/commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,26 @@ func builtInSessionCommands() []Item {
return core.CmdHandler(messages.ExitSessionMsg{})
},
},
{
ID: "session.quit",
Label: "Quit",
SlashCommand: "/quit",
Description: "Quit the application (alias for /exit)",
Category: "Session",
Execute: func(string) tea.Cmd {
return core.CmdHandler(messages.ExitSessionMsg{})
},
},
{
ID: "session.q",
Label: "Quit (short)",
SlashCommand: "/q",
Description: "Quit the application (alias for /exit)",
Category: "Session",
Execute: func(string) tea.Cmd {
return core.CmdHandler(messages.ExitSessionMsg{})
},
},
{
ID: "session.export",
Label: "Export",
Expand Down
7 changes: 7 additions & 0 deletions pkg/tui/page/chat/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,13 @@ func (p *chatPage) cancelStream(showCancelMessage bool) tea.Cmd {
// handleSendMsg handles incoming messages from the editor, either processing
// them immediately or queuing them if the agent is busy.
func (p *chatPage) handleSendMsg(msg msgtypes.SendMsg) (layout.Model, tea.Cmd) {
// Handle "exit", "quit", and ":q" as special keywords to quit the session
// immediately, equivalent to the /exit slash command.
switch strings.TrimSpace(msg.Content) {
case "exit", "quit", ":q":
return p, core.CmdHandler(msgtypes.ExitSessionMsg{})
}

// Predefined slash commands (e.g., /yolo, /exit, /compact) execute immediately
// even while the agent is working - they're UI commands that don't interrupt the stream.
// Custom agent commands (defined in config) should still be queued.
Expand Down
Loading