[FEATURE] VS Code extension: support ide_selection for text selected in integrated terminal
Feature Description
When text is selected in VS Code's integrated terminal panel, the Claude Code extension does not include it as ide_selection context. Only selections in regular editor tabs are captured. This means users cannot highlight terminal output (error messages, command results, test failures, etc.) and ask Claude about it with that context automatically attached.
Use Case
A common workflow is:
- Run a command in the integrated terminal (build, test, curl, etc.)
- See an error or interesting output
- Select that text
- Ask Claude "what does this mean?" or "how do I fix this?"
Currently, Claude doesn't see the selected terminal text, so the user has to manually copy-paste it into the prompt.
Why This Doesn't Work Today
The VS Code extension API's window.activeTextEditor does not cover terminal panels — terminals use a separate Terminal API that doesn't expose selection in the same way. Supporting this would likely require using the window.onDidChangeTerminalSelection or similar API surface to capture terminal selections.
Related Issues
- #8451 — covers
ide_selectionnot working for editor files (different root cause, but similar user-facing symptom)
Environment
- Platform: macOS (likely affects all platforms)
- Claude Code VS Code extension
Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>