From 5bca10d73cb0d7c56a3e6d4f558b86c3ac40d8b4 Mon Sep 17 00:00:00 2001 From: Chris Estreich Date: Fri, 2 May 2025 19:52:11 -0700 Subject: [PATCH] Fix empty command bug (#3139) --- .changeset/chilled-books-relate.md | 5 +++++ webview-ui/src/components/chat/CommandExecution.tsx | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changeset/chilled-books-relate.md 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)) }