MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / OutputLine

Function OutputLine

source code/components/shell/OutputLine.tsx:49–106  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

47 return content.replace(URL_IN_JSON, url => createHyperlink(url));
48}
49export function OutputLine(t0) {
50 const $ = _c(11);
51 const {
52 content,
53 verbose,
54 isError,
55 isWarning,
56 linkifyUrls
57 } = t0;
58 const {
59 columns
60 } = useTerminalSize();
61 const expandShellOutput = useExpandShellOutput();
62 const inVirtualList = React.useContext(InVirtualListContext);
63 const shouldShowFull = verbose || expandShellOutput;
64 let t1;
65 if ($[0] !== columns || $[1] !== content || $[2] !== inVirtualList || $[3] !== linkifyUrls || $[4] !== shouldShowFull) {
66 bb0: {
67 let formatted = tryJsonFormatContent(content);
68 if (linkifyUrls) {
69 formatted = linkifyUrlsInText(formatted);
70 }
71 if (shouldShowFull) {
72 t1 = stripUnderlineAnsi(formatted);
73 break bb0;
74 }
75 t1 = stripUnderlineAnsi(renderTruncatedContent(formatted, columns, inVirtualList));
76 }
77 $[0] = columns;
78 $[1] = content;
79 $[2] = inVirtualList;
80 $[3] = linkifyUrls;
81 $[4] = shouldShowFull;
82 $[5] = t1;
83 } else {
84 t1 = $[5];
85 }
86 const formattedContent = t1;
87 const color = isError ? "error" : isWarning ? "warning" : undefined;
88 let t2;
89 if ($[6] !== formattedContent) {
90 t2 = <Ansi>{formattedContent}</Ansi>;
91 $[6] = formattedContent;
92 $[7] = t2;
93 } else {
94 t2 = $[7];
95 }
96 let t3;
97 if ($[8] !== color || $[9] !== t2) {
98 t3 = <MessageResponse><Text color={color}>{t2}</Text></MessageResponse>;
99 $[8] = color;
100 $[9] = t2;
101 $[10] = t3;
102 } else {
103 t3 = $[10];
104 }
105 return t3;
106}

Callers

nothing calls this directly

Calls 6

useTerminalSizeFunction · 0.85
useExpandShellOutputFunction · 0.85
tryJsonFormatContentFunction · 0.85
linkifyUrlsInTextFunction · 0.85
stripUnderlineAnsiFunction · 0.85
renderTruncatedContentFunction · 0.85

Tested by

no test coverage detected