File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
crates/chat-cli/src/cli/chat Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -1223,13 +1223,17 @@ impl ChatSession {
1223
1223
args. insert ( 0 , "q" . to_owned ( ) ) ;
1224
1224
match SlashCommand :: try_parse_from ( args) {
1225
1225
Ok ( command) => {
1226
- if let Err ( err) = command. execute ( ctx, database, telemetry, self ) . await {
1227
- queue ! (
1228
- self . output,
1229
- style:: SetForegroundColor ( Color :: Red ) ,
1230
- style:: Print ( format!( "Failed to execute command: {}\n " , err) ) ,
1231
- style:: SetForegroundColor ( Color :: Reset )
1232
- ) ?;
1226
+ match command. execute ( ctx, database, telemetry, self ) . await {
1227
+ Ok ( chat_state) if matches ! ( chat_state, ChatState :: Exit ) => return Ok ( chat_state) ,
1228
+ Err ( err) => {
1229
+ queue ! (
1230
+ self . output,
1231
+ style:: SetForegroundColor ( Color :: Red ) ,
1232
+ style:: Print ( format!( "Failed to execute command: {}\n " , err) ) ,
1233
+ style:: SetForegroundColor ( Color :: Reset )
1234
+ ) ?;
1235
+ } ,
1236
+ _ => { } ,
1233
1237
}
1234
1238
1235
1239
writeln ! ( self . output) ?;
You can’t perform that action at this time.
0 commit comments