Skip to content

Commit 349eeba

Browse files
authored
fix: render buffered output on terminal session attach (#51)
AttachSession returns a buffer containing any output that arrived before the UI attached (e.g. the shell prompt). The return value was being ignored, so the initial prompt never appeared — users had to type a command before seeing any output.
1 parent 89cf055 commit 349eeba

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

ui/providers/BottomDrawer/containers/Terminal.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,11 @@ export default function TerminalContainer({ sessionId, tab }: Props) {
309309
});
310310

311311
try {
312-
await ExecClient.AttachSession(sessionId);
312+
const result = await ExecClient.AttachSession(sessionId);
313+
if (result.buffer) {
314+
const decoded = textDecoder.decode(Base64.toUint8Array(result.buffer));
315+
terminal.write(decoded);
316+
}
313317
} catch (e) {
314318
log.error(new Error(parseAppError(e).detail), { event: 'attach_session', sessionId });
315319
}

0 commit comments

Comments
 (0)