@@ -116,7 +116,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
116116 const [ selectedImages , setSelectedImages ] = useState < string [ ] > ( [ ] )
117117
118118 // we need to hold on to the ask because useEffect > lastMessage will always let us know when an ask comes in and handle it, but by the time handleMessage is called, the last message might not be the ask anymore (it could be a say that followed)
119- const [ clineAsk , setClineAsk ] = useState < ClineAsk | "command_output" | undefined > ( undefined )
119+ const [ clineAsk , setClineAsk ] = useState < ClineAsk | undefined > ( undefined )
120120 const [ enableButtons , setEnableButtons ] = useState < boolean > ( false )
121121 const [ primaryButtonText , setPrimaryButtonText ] = useState < string | undefined > ( undefined )
122122 const [ secondaryButtonText , setSecondaryButtonText ] = useState < string | undefined > ( undefined )
@@ -229,6 +229,13 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
229229 setPrimaryButtonText ( t ( "chat:runCommand.title" ) )
230230 setSecondaryButtonText ( t ( "chat:reject.title" ) )
231231 break
232+ case "command_output" :
233+ setTextAreaDisabled ( false )
234+ setClineAsk ( "command_output" )
235+ setEnableButtons ( true )
236+ setPrimaryButtonText ( t ( "chat:proceedWhileRunning.title" ) )
237+ setSecondaryButtonText ( t ( "chat:killCommand.title" ) )
238+ break
232239 case "use_mcp_server" :
233240 if ( ! isAutoApproved ( lastMessage ) && ! isPartial ) {
234241 playSound ( "notification" )
@@ -282,8 +289,8 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
282289 setTextAreaDisabled ( true )
283290 break
284291 case "api_req_started" :
285- if ( secondLastMessage ?. ask === "command " ) {
286- // If the last ask is a command , and we
292+ if ( secondLastMessage ?. ask === "command_output " ) {
293+ // If the last ask is a command_output , and we
287294 // receive an api_req_started, then that means
288295 // the command has finished and we don't need
289296 // input from the user anymore (in every other
@@ -297,18 +304,12 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
297304 setEnableButtons ( false )
298305 }
299306 break
300- case "command_output" :
301- setTextAreaDisabled ( false )
302- setClineAsk ( "command_output" )
303- setEnableButtons ( true )
304- setPrimaryButtonText ( t ( "chat:proceedWhileRunning.title" ) )
305- setSecondaryButtonText ( t ( "chat:killCommand.title" ) )
306- break
307307 case "api_req_finished" :
308308 case "error" :
309309 case "text" :
310310 case "browser_action" :
311311 case "browser_action_result" :
312+ case "command_output" :
312313 case "mcp_server_request_started" :
313314 case "mcp_server_response" :
314315 case "completion_result" :
@@ -398,6 +399,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
398399 case "tool" :
399400 case "browser_action_launch" :
400401 case "command" : // User can provide feedback to a tool or command use.
402+ case "command_output" : // User can send input to command stdin.
401403 case "use_mcp_server" :
402404 case "completion_result" : // If this happens then the user has feedback for the completion result.
403405 case "resume_task" :
@@ -439,8 +441,6 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
439441 ( text ?: string , images ?: string [ ] ) => {
440442 const trimmedInput = text ?. trim ( )
441443
442- console . log ( `handlePrimaryButtonClick -> clineAsk=${ clineAsk } ` , text )
443-
444444 switch ( clineAsk ) {
445445 case "api_req_failed" :
446446 case "command" :
@@ -521,7 +521,6 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
521521 vscode . postMessage ( { type : "terminalOperation" , terminalOperation : "abort" } )
522522 break
523523 }
524-
525524 setTextAreaDisabled ( true )
526525 setClineAsk ( undefined )
527526 setEnableButtons ( false )
@@ -750,8 +749,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
750749 return alwaysAllowExecute && isAllowedCommand ( message )
751750 }
752751
753- // For read/write operations, check if it's outside workspace and
754- // if we have permission for that.
752+ // For read/write operations, check if it's outside workspace and if we have permission for that
755753 if ( message . ask === "tool" ) {
756754 let tool : any = { }
757755
0 commit comments