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

Function formatBashOutput

source code/utils/promptShellExecution.ts:147–167  ·  view source on GitHub ↗
(
  stdout: string,
  stderr: string,
  inline = false,
)

Source from the content-addressed store, hash-verified

145}
146
147function formatBashOutput(
148 stdout: string,
149 stderr: string,
150 inline = false,
151): string {
152 const parts: string[] = []
153
154 if (stdout.trim()) {
155 parts.push(stdout.trim())
156 }
157
158 if (stderr.trim()) {
159 if (inline) {
160 parts.push(`[stderr: ${stderr.trim()}]`)
161 } else {
162 parts.push(`[stderr]\n${stderr.trim()}`)
163 }
164 }
165
166 return parts.join(inline ? ' ' : '\n')
167}
168
169function formatBashError(e: unknown, pattern: string, inline = false): never {
170 if (e instanceof ShellError) {

Callers 2

formatBashErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected