Skip to content

fix: render buffered output on terminal session attach - #51

Merged
joshuapare merged 1 commit into
mainfrom
fix/terminal-attach-buffer
Mar 28, 2026
Merged

fix: render buffered output on terminal session attach#51
joshuapare merged 1 commit into
mainfrom
fix/terminal-attach-buffer

Conversation

@joshuapare

@joshuapare joshuapare commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • AttachSession returns a buffer containing output that arrived before the UI attached (e.g. the shell prompt), but the return value was ignored
  • The initial prompt never appeared — users had to type a command before seeing any output
  • Now writes the buffer contents to the xterm terminal after attaching

Companion to omniviewdev/plugin-sdk#8 (merged as v0.5.1) which fixed sessions being destroyed immediately after creation.

Test plan

  • Exec into a pod — initial shell prompt should appear immediately without needing to type first

Summary by CodeRabbit

  • Bug Fixes
    • Terminal sessions now display initial output immediately upon attachment, improving responsiveness.

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.
@coderabbitai

coderabbitai Bot commented Mar 28, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: ac0b2dd5-94f9-459d-af49-42c7da3d8d52

📥 Commits

Reviewing files that changed from the base of the PR and between 89cf055 and cd3309c.

📒 Files selected for processing (1)
  • ui/providers/BottomDrawer/containers/Terminal.tsx

📝 Walkthrough

Walkthrough

The change enhances session attachment by capturing the return value from ExecClient.AttachSession() and processing any initial buffer data. When a buffer is present, it decodes the base64-encoded content and writes it to the terminal before stream event listeners take over.

Changes

Cohort / File(s) Summary
Terminal Session Buffer Handling
ui/providers/BottomDrawer/containers/Terminal.tsx
Capture return value from AttachSession() and decode base64-encoded buffer data, writing initial output to xterm when available.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 A buffer arrives, encoded and neat,
Base64 whispers, a welcome to greet!
Decode and display, the first words appear—
Terminal speaks softly, so crisp and so clear! 📡✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: render buffered output on terminal session attach' directly and clearly describes the main change in the PR—handling buffered output from AttachSession and rendering it to the terminal.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/terminal-attach-buffer

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@joshuapare
joshuapare merged commit 349eeba into main Mar 28, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant