Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 5, 2026

Terminal Streaming Implementation Plan

Based on analysis of PR #278888, I need to bring terminal streaming functionality to the current main branch. The PR adds real-time streaming of terminal command output in chat.

Analysis Complete:

  • Analyzed PR add streaming for the terminal inlined in chat #278888 changes (7 files modified)
  • Identified current main branch structure differs slightly from PR branch
  • Confirmed key files exist but lack streaming functionality
  • Confirmed getRangeAsVT API already exists in terminal.ts

Core Changes Needed:

1. Terminal Command Mirror Streaming (chatTerminalCommandMirror.ts)

  • Replace static snapshot rendering with streaming implementation
  • Add onDidUpdate event emitter for real-time updates
  • Implement cursor tracking and dirty range flushing
  • Add streaming lifecycle management (start/stop)
  • Handle incremental VT sequence updates

2. Chat Terminal Tool Progress Part (chatTerminalToolProgressPart.ts)

  • Remove HTML sanitization and static output rendering
  • Integrate streaming mirror for terminal output
  • Add prepareMirrorForStreaming to initialize streaming early
  • Update command execution listeners to trigger streaming
  • Implement dynamic height calculation based on line count
  • Add empty state messages and terminal host management

3. Terminal Command Artifact Collector (terminalCommandArtifactCollector.ts)

  • Remove fallbackOutput parameter from capture method
  • Remove HTML serialization logic
  • Simplify to only store command metadata (not output)
  • Remove _tryGetSerializedCommandOutput method

4. Run In Terminal Tool (runInTerminalTool.ts)

  • Update capture calls to remove fallback output parameter

5. CSS Updates (chatTerminalToolProgressPart.css)

  • Add focus-visible styling for output container
  • Update layout for terminal host element
  • Add no-output state styling
  • Hide decoration overview ruler

6. Xterm Terminal (xtermTerminal.ts)

  • Verify getRangeAsVT implementation (appears already complete)

Testing Strategy:

  • Build and compile TypeScript changes
  • Test terminal command execution with streaming output
  • Verify output updates in real-time
  • Test edge cases (no output, long output, command completion)
Original prompt

This PR brings the terminal streaming functionality originally developed in #278888 ("add streaming for the terminal inlined in chat") onto the current main branch. The original PR cannot be merged directly due to extensive merge conflicts.

Tasks:

  • Analyze all code changes from PR add streaming for the terminal inlined in chat #278888 related to terminal streaming in chat and identify the affected files.
  • Apply only the streaming-related changes to the current main branch, resolving any and all merge conflicts or incompatibilities, and ensuring the logic aligns with the main branch's current codebase.
  • Do not include unrelated refactors or features from the original PR unless necessary for terminal streaming.
  • Test and verify that streaming works correctly for terminal inlined in chat against main branch integrations.

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

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.

2 participants