Skip to content

Commit daf0eaf

Browse files
committed
refined terminal output
1 parent 40ff64f commit daf0eaf

File tree

1 file changed

+23
-11
lines changed

1 file changed

+23
-11
lines changed

frontend/src/components/thread/tool-views/command-tool/CommandToolView.tsx

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -174,21 +174,33 @@ export function CommandToolView({
174174
)}
175175
</div>
176176
<div className="p-4 max-h-96 overflow-auto scrollbar-hide">
177-
<pre className="text-xs text-zinc-600 dark:text-zinc-300 font-mono whitespace-pre-wrap break-all overflow-visible">
178-
{/* Show command only */}
177+
{/* Command line */}
178+
<div className="py-0.5 bg-transparent font-mono text-xs">
179179
{command && (
180-
<div className="py-0.5 bg-transparent">
180+
<>
181181
<span className="text-green-500 dark:text-green-400 font-semibold">{displayPrefix} </span>
182182
<span className="text-zinc-700 dark:text-zinc-300">{command}</span>
183-
</div>
183+
</>
184184
)}
185+
</div>
185186

186-
{!showFullOutput && hasMoreLines && (
187-
<div className="text-zinc-500 mt-2 border-t border-zinc-700/30 pt-2">
188-
+ {formattedOutput.length - 10} more lines
189-
</div>
190-
)}
191-
</pre>
187+
{/* Terminal output (render as real terminal text, not JSON) */}
188+
{formattedOutput.length > 0 && (
189+
<pre className="mt-2 text-xs text-zinc-600 dark:text-zinc-300 font-mono whitespace-pre-wrap break-words">
190+
{linesToShow.map((line, idx) => (
191+
<span key={idx}>
192+
{line}
193+
{'\n'}
194+
</span>
195+
))}
196+
</pre>
197+
)}
198+
199+
{!showFullOutput && hasMoreLines && (
200+
<div className="text-zinc-500 mt-2 border-t border-zinc-700/30 pt-2 text-xs font-mono">
201+
+ {formattedOutput.length - 10} more lines
202+
</div>
203+
)}
192204
</div>
193205
</div>
194206
</div>
@@ -242,4 +254,4 @@ export function CommandToolView({
242254
</div>
243255
</Card>
244256
);
245-
}
257+
}

0 commit comments

Comments
 (0)