Skip to content

Commit 57101c2

Browse files
author
Eric Wheeler
committed
fix: show properly formatted multi-line commands in preview
Replace Line component with CodeBlock to display complete multi-line commands with proper formatting and line breaks in the preview. This fix is important because users must be able to review commands with correct indentation and structure before execution for safety. Fixes: #3367 Signed-off-by: Eric Wheeler <[email protected]>
1 parent ee2033c commit 57101c2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { vscode } from "@src/utils/vscode"
1212
import { useExtensionState } from "@src/context/ExtensionStateContext"
1313
import { cn } from "@src/lib/utils"
1414
import { Button } from "@src/components/ui"
15+
import CodeBlock from "../common/CodeBlock"
1516

1617
interface CommandExecutionProps {
1718
executionId: string
@@ -86,8 +87,8 @@ export const CommandExecution = ({ executionId, text }: CommandExecutionProps) =
8687

8788
return (
8889
<div className="w-full bg-vscode-editor-background border border-vscode-border rounded-xs p-2">
90+
<CodeBlock source={command} language="shell" />
8991
<div className="flex flex-row items-center justify-between gap-2 px-1">
90-
<Line className="text-sm whitespace-nowrap overflow-hidden text-ellipsis">{command}</Line>
9192
<div className="flex flex-row items-center gap-1">
9293
{status?.status === "started" && (
9394
<div className="flex flex-row items-center gap-2 font-mono text-xs">

0 commit comments

Comments
 (0)