* Read the tail of the task output file. Only reads the last few KB, * not the entire file.
(shell: DeepImmutable<LocalShellTaskState>)
| 29 | * not the entire file. |
| 30 | */ |
| 31 | async function getTaskOutput(shell: DeepImmutable<LocalShellTaskState>): Promise<TaskOutputResult> { |
| 32 | const path = getTaskOutputPath(shell.id); |
| 33 | try { |
| 34 | const result = await tailFile(path, SHELL_DETAIL_TAIL_BYTES); |
| 35 | return { content: result.content, bytesTotal: result.bytesTotal }; |
| 36 | } catch { |
| 37 | return { content: '', bytesTotal: 0 }; |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | export function ShellDetailDialog({ shell, onDone, onKillShell, onBack }: Props): React.ReactNode { |
| 42 | const { columns } = useTerminalSize(); |
no test coverage detected