[PR #6970] Add Agent terminal panel for viewing bash command output #12185

Open
opened 2026-02-16 18:17:06 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/6970

State: open
Merged: No


image

Summary

  • Designed to be combined with this PR: https://github.com/anomalyco/opencode/pull/6893
  • Add new "Agent" tab to terminal panel that displays real-time streaming output from agent bash commands
  • Auto-focus Agent tab when agent runs commands (unless user has interacted with PTY terminals)
  • Show spinner indicator on Agent tab when commands are running
  • Support ANSI color codes in output using ansi-to-html
  • Hide Agent tab in empty session state (before first message is sent)

Bug Fixes

  • Fix duplicate terminal creation on session load by adding ready() check and creating guard
  • Track user interaction with PTY terminals to control auto-focus behavior

New Files

  • packages/app/src/context/agent-terminal.tsx - Context for tracking bash tool commands
  • packages/app/src/components/agent-terminal.tsx - UI component for agent terminal output with ANSI color support

Demo

The Agent tab appears on the right side of the terminal panel tabs. When the agent runs bash commands, the output streams in real-time with colored output support. If the user hasn't interacted with any PTY terminal tabs, the Agent tab will auto-focus when commands start running.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/6970 **State:** open **Merged:** No --- <img width="1470" height="859" alt="image" src="https://github.com/user-attachments/assets/7517a3a5-4fe8-437f-99c7-2ce9a76d62ff" /> ## Summary - Designed to be combined with this PR: https://github.com/anomalyco/opencode/pull/6893 - Add new "Agent" tab to terminal panel that displays real-time streaming output from agent bash commands - Auto-focus Agent tab when agent runs commands (unless user has interacted with PTY terminals) - Show spinner indicator on Agent tab when commands are running - Support ANSI color codes in output using `ansi-to-html` - Hide Agent tab in empty session state (before first message is sent) ## Bug Fixes - Fix duplicate terminal creation on session load by adding `ready()` check and `creating` guard - Track user interaction with PTY terminals to control auto-focus behavior ## New Files - `packages/app/src/context/agent-terminal.tsx` - Context for tracking bash tool commands - `packages/app/src/components/agent-terminal.tsx` - UI component for agent terminal output with ANSI color support ## Demo The Agent tab appears on the right side of the terminal panel tabs. When the agent runs bash commands, the output streams in real-time with colored output support. If the user hasn't interacted with any PTY terminal tabs, the Agent tab will auto-focus when commands start running.
yindo added the pull-request label 2026-02-16 18:17:06 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12185