Skip to content

Commit a1ef96b

Browse files
authored
Merge pull request #1248 from kubet/pr-1205
Merge fixes from refined terminal output @Chaitanya045
2 parents 15669fd + 60dde88 commit a1ef96b

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

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

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -211,32 +211,33 @@ export function CommandToolView({
211211
)}
212212
</div>
213213
<div className="p-4 max-h-96 overflow-auto scrollbar-hide">
214-
<pre className="text-xs text-zinc-600 dark:text-zinc-300 font-mono whitespace-pre-wrap break-all overflow-visible">
215-
{/* Show command only */}
214+
{/* Command line */}
215+
<div className="py-0.5 bg-transparent font-mono text-xs">
216216
{command && (
217-
<div className="py-0.5 bg-transparent">
217+
<>
218218
<span className="text-green-500 dark:text-green-400 font-semibold">{displayPrefix} </span>
219219
<span className="text-zinc-700 dark:text-zinc-300">{command}</span>
220-
</div>
221-
)}
222-
223-
{/* Show output only if there's actual command output */}
224-
{hasActualOutput && formattedOutput.length > 0 && (
225-
<>
226-
{formattedOutput.map((line, index) => (
227-
<div key={index} className="py-0.5 bg-transparent">
228-
<span className="text-zinc-600 dark:text-zinc-300">{line}</span>
229-
</div>
230-
))}
231220
</>
232221
)}
222+
</div>
233223

234-
{!showFullOutput && hasMoreLines && (
235-
<div className="text-zinc-500 mt-2 border-t border-zinc-700/30 pt-2">
236-
+ {formattedOutput.length - 10} more lines
237-
</div>
238-
)}
239-
</pre>
224+
{/* Terminal output (render as real terminal text, not JSON) */}
225+
{formattedOutput.length > 0 && (
226+
<pre className="mt-2 text-xs text-zinc-600 dark:text-zinc-300 font-mono whitespace-pre-wrap break-words">
227+
{linesToShow.map((line, idx) => (
228+
<span key={idx}>
229+
{line}
230+
{'\n'}
231+
</span>
232+
))}
233+
</pre>
234+
)}
235+
236+
{!showFullOutput && hasMoreLines && (
237+
<div className="text-zinc-500 mt-2 border-t border-zinc-700/30 pt-2 text-xs font-mono">
238+
+ {formattedOutput.length - 10} more lines
239+
</div>
240+
)}
240241
</div>
241242
</div>
242243
</div>
@@ -301,4 +302,4 @@ export function CommandToolView({
301302
</div>
302303
</Card>
303304
);
304-
}
305+
}

0 commit comments

Comments
 (0)