Skip to content

Commit 776df15

Browse files
authored
Revert "Fix empty command bug (#3139)"
This reverts commit 5bca10d.
1 parent 40ee5cf commit 776df15

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 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(text)
30+
const [command, setCommand] = useState("")
3131

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

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

0 commit comments

Comments
 (0)