Skip to content

Commit 7ac65b7

Browse files
committed
Fix empty command bug
1 parent dd3cd7f commit 7ac65b7

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.changeset/chilled-books-relate.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"roo-cline": patch
3+
---
4+
5+
Fix empty command bug

webview-ui/src/components/chat/CommandExecution.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const CommandExecution = ({ executionId, text }: CommandExecutionProps) =
2727

2828
const [status, setStatus] = useState<CommandExecutionStatus | null>(null)
2929
const [output, setOutput] = useState("")
30-
const [command, setCommand] = useState("")
30+
const [command, setCommand] = useState(text)
3131

3232
const lines = useMemo(
3333
() => [`$ ${command}`, ...output.split("\n").filter((line) => line.trim() !== "")],
@@ -79,7 +79,9 @@ export const CommandExecution = ({ executionId, text }: CommandExecutionProps) =
7979
if (!status && text) {
8080
const index = text.indexOf(COMMAND_OUTPUT_STRING)
8181

82-
if (index !== -1) {
82+
if (index === -1) {
83+
setCommand(text)
84+
} else {
8385
setCommand(text.slice(0, index))
8486
setOutput(text.slice(index + COMMAND_OUTPUT_STRING.length))
8587
}

0 commit comments

Comments
 (0)