@@ -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 | undefined > ( undefined )
119+ const [ clineAsk , setClineAsk ] = useState < ClineAsk | "command_output" | 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,13 +229,6 @@ 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
239232 case "use_mcp_server" :
240233 if ( ! isAutoApproved ( lastMessage ) && ! isPartial ) {
241234 playSound ( "notification" )
@@ -289,8 +282,8 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
289282 setTextAreaDisabled ( true )
290283 break
291284 case "api_req_started" :
292- if ( secondLastMessage ?. ask === "command_output " ) {
293- // If the last ask is a command_output , and we
285+ if ( secondLastMessage ?. ask === "command " ) {
286+ // If the last ask is a command , and we
294287 // receive an api_req_started, then that means
295288 // the command has finished and we don't need
296289 // input from the user anymore (in every other
@@ -304,12 +297,18 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
304297 setEnableButtons ( false )
305298 }
306299 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" :
313312 case "mcp_server_request_started" :
314313 case "mcp_server_response" :
315314 case "completion_result" :
@@ -399,7 +398,6 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
399398 case "tool" :
400399 case "browser_action_launch" :
401400 case "command" : // User can provide feedback to a tool or command use.
402- case "command_output" : // User can send input to command stdin.
403401 case "use_mcp_server" :
404402 case "completion_result" : // If this happens then the user has feedback for the completion result.
405403 case "resume_task" :
@@ -521,6 +519,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
521519 vscode . postMessage ( { type : "terminalOperation" , terminalOperation : "abort" } )
522520 break
523521 }
522+
524523 setTextAreaDisabled ( true )
525524 setClineAsk ( undefined )
526525 setEnableButtons ( false )
0 commit comments