(output: ShellOutput)
| 120 | } |
| 121 | |
| 122 | function formatShellOutput(output: ShellOutput): string { |
| 123 | if (output.mode === 'pty') { |
| 124 | const terminal = ptyHumanTerminalText(output); |
| 125 | return terminal ? `terminal:\n${terminal}` : ''; |
| 126 | } |
| 127 | return [ |
| 128 | output.stdout ? `stdout:\n${output.stdout}` : '', |
| 129 | output.stderr ? `stderr:\n${output.stderr}` : '', |
| 130 | ] |
| 131 | .filter(Boolean) |
| 132 | .join('\n\n'); |
| 133 | } |
| 134 | |
| 135 | export function formatUnknown(value: unknown): string { |
| 136 | if (typeof value === 'string') return value; |
no test coverage detected