mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Fix empty command bug (#3139)
This commit is contained in:
parent
dd3cd7fd7d
commit
5bca10d73c
2 changed files with 9 additions and 2 deletions
5
.changeset/chilled-books-relate.md
Normal file
5
.changeset/chilled-books-relate.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"roo-cline": patch
|
||||
---
|
||||
|
||||
Fix empty command bug
|
||||
|
|
@ -27,7 +27,7 @@ export const CommandExecution = ({ executionId, text }: CommandExecutionProps) =
|
|||
|
||||
const [status, setStatus] = useState<CommandExecutionStatus | null>(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))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue