Chris Estreich 8 месяцев назад
Родитель
Сommit
5bca10d73c
2 измененных файлов с 9 добавлено и 2 удалено
  1. 5 0
      .changeset/chilled-books-relate.md
  2. 4 2
      webview-ui/src/components/chat/CommandExecution.tsx

+ 5 - 0
.changeset/chilled-books-relate.md

@@ -0,0 +1,5 @@
+---
+"roo-cline": patch
+---
+
+Fix empty command bug

+ 4 - 2
webview-ui/src/components/chat/CommandExecution.tsx

@@ -27,7 +27,7 @@ export const CommandExecution = ({ executionId, text }: CommandExecutionProps) =
 
 
 	const [status, setStatus] = useState<CommandExecutionStatus | null>(null)
 	const [status, setStatus] = useState<CommandExecutionStatus | null>(null)
 	const [output, setOutput] = useState("")
 	const [output, setOutput] = useState("")
-	const [command, setCommand] = useState("")
+	const [command, setCommand] = useState(text)
 
 
 	const lines = useMemo(
 	const lines = useMemo(
 		() => [`$ ${command}`, ...output.split("\n").filter((line) => line.trim() !== "")],
 		() => [`$ ${command}`, ...output.split("\n").filter((line) => line.trim() !== "")],
@@ -79,7 +79,9 @@ export const CommandExecution = ({ executionId, text }: CommandExecutionProps) =
 		if (!status && text) {
 		if (!status && text) {
 			const index = text.indexOf(COMMAND_OUTPUT_STRING)
 			const index = text.indexOf(COMMAND_OUTPUT_STRING)
 
 
-			if (index !== -1) {
+			if (index === -1) {
+				setCommand(text)
+			} else {
 				setCommand(text.slice(0, index))
 				setCommand(text.slice(0, index))
 				setOutput(text.slice(index + COMMAND_OUTPUT_STRING.length))
 				setOutput(text.slice(index + COMMAND_OUTPUT_STRING.length))
 			}
 			}