diff --git a/.changeset/chilled-books-relate.md b/.changeset/chilled-books-relate.md new file mode 100644 index 0000000000..281d55d104 --- /dev/null +++ b/.changeset/chilled-books-relate.md @@ -0,0 +1,5 @@ +--- +"roo-cline": patch +--- + +Fix empty command bug diff --git a/webview-ui/src/components/chat/CommandExecution.tsx b/webview-ui/src/components/chat/CommandExecution.tsx index f5cd63ff03..827e711948 100644 --- a/webview-ui/src/components/chat/CommandExecution.tsx +++ b/webview-ui/src/components/chat/CommandExecution.tsx @@ -27,7 +27,7 @@ export const CommandExecution = ({ executionId, text }: CommandExecutionProps) = const [status, setStatus] = useState(null) const [output, setOutput] = useState("") - const [command, setCommand] = useState("") + const [command, setCommand] = useState(text) const lines = useMemo( () => [`$ ${command}`, ...output.split("\n").filter((line) => line.trim() !== "")], @@ -79,7 +79,9 @@ export const CommandExecution = ({ executionId, text }: CommandExecutionProps) = if (!status && text) { const index = text.indexOf(COMMAND_OUTPUT_STRING) - if (index !== -1) { + if (index === -1) { + setCommand(text) + } else { setCommand(text.slice(0, index)) setOutput(text.slice(index + COMMAND_OUTPUT_STRING.length)) }