File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
packages/cli/src/ui/hooks Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -321,7 +321,9 @@ export const useSlashCommandProcessor = (
321321 }
322322
323323 const trimmed = rawQuery . trim ( ) ;
324- const isExitOrQuit = [ 'exit' , 'quit' ] . includes ( trimmed . toLowerCase ( ) ) ;
324+ const parts = trimmed . split ( / \s + / ) ;
325+ const commandWord = parts [ 0 ] . toLowerCase ( ) ;
326+ const isExitOrQuit = commandWord === 'exit' || commandWord === 'quit' ;
325327 if (
326328 ! trimmed . startsWith ( '/' ) &&
327329 ! trimmed . startsWith ( '?' ) &&
@@ -341,7 +343,15 @@ export const useSlashCommandProcessor = (
341343 }
342344
343345 let hasError = false ;
344- const commandToParse = isExitOrQuit ? `/${ trimmed } ` : trimmed ;
346+ let commandToParse = trimmed ;
347+ if (
348+ isExitOrQuit &&
349+ ! trimmed . startsWith ( '/' ) &&
350+ ! trimmed . startsWith ( '?' )
351+ ) {
352+ parts [ 0 ] = commandWord ;
353+ commandToParse = `/${ parts . join ( ' ' ) } ` ;
354+ }
345355 const {
346356 commandToExecute,
347357 args,
You can’t perform that action at this time.
0 commit comments