File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -107,6 +107,26 @@ func builtInSessionCommands() []Item {
107107 return core .CmdHandler (messages.ExitSessionMsg {})
108108 },
109109 },
110+ {
111+ ID : "session.quit" ,
112+ Label : "Quit" ,
113+ SlashCommand : "/quit" ,
114+ Description : "Quit the application (alias for /exit)" ,
115+ Category : "Session" ,
116+ Execute : func (string ) tea.Cmd {
117+ return core .CmdHandler (messages.ExitSessionMsg {})
118+ },
119+ },
120+ {
121+ ID : "session.q" ,
122+ Label : "Quit (short)" ,
123+ SlashCommand : "/q" ,
124+ Description : "Quit the application (alias for /exit)" ,
125+ Category : "Session" ,
126+ Execute : func (string ) tea.Cmd {
127+ return core .CmdHandler (messages.ExitSessionMsg {})
128+ },
129+ },
110130 {
111131 ID : "session.export" ,
112132 Label : "Export" ,
Original file line number Diff line number Diff line change @@ -624,6 +624,13 @@ func (p *chatPage) cancelStream(showCancelMessage bool) tea.Cmd {
624624// handleSendMsg handles incoming messages from the editor, either processing
625625// them immediately or queuing them if the agent is busy.
626626func (p * chatPage ) handleSendMsg (msg msgtypes.SendMsg ) (layout.Model , tea.Cmd ) {
627+ // Handle "exit", "quit", and ":q" as special keywords to quit the session
628+ // immediately, equivalent to the /exit slash command.
629+ switch strings .TrimSpace (msg .Content ) {
630+ case "exit" , "quit" , ":q" :
631+ return p , core .CmdHandler (msgtypes.ExitSessionMsg {})
632+ }
633+
627634 // Predefined slash commands (e.g., /yolo, /exit, /compact) execute immediately
628635 // even while the agent is working - they're UI commands that don't interrupt the stream.
629636 // Custom agent commands (defined in config) should still be queued.
You can’t perform that action at this time.
0 commit comments