feat: add experimental Shielded Terminal for API key masking in VS Code#9
Merged
easyvibecoding merged 2 commits intomainfrom Mar 21, 2026
Merged
feat: add experimental Shielded Terminal for API key masking in VS Code#9easyvibecoding merged 2 commits intomainfrom
easyvibecoding merged 2 commits intomainfrom
Conversation
Add a Shielded Terminal (Pseudoterminal + node-pty proxy) that masks API keys in terminal output before rendering. Designed to work with Claude Code and other CLI tools during demos/livestreams. Key technical decisions: - DEC 2026 sync block buffering: Claude Code wraps each Ink render in \x1b[?2026h...\x1b[?2026l. Buffer entire sync blocks before masking to ensure keys split across PTY chunks are fully assembled. - ANSI + whitespace stripping for matching: Ink inserts \r\n + indent spaces when word-wrapping long keys. Strip ALL whitespace alongside ANSI codes for regex matching, preserve structural chars in output. - node-pty triple fallback: system → VS Code internal (asar) → VS Code internal (plain). Falls back to child_process line-mode terminal. Features: - 25 built-in terminal patterns (OpenAI, Anthropic, GitHub, AWS, etc.) - Ctrl+Shift+T or Command Palette → "Open Shielded Terminal" - "Open Terminal With Command" (default: claude) - Opens as editor tab (TerminalLocation.Editor) - Shield always ON by default, syncs with Demo Mode - Pattern updates from Core via IPC reflected in real-time Known limitations (marked experimental): - Rewind confirmation page may show partial key tail - node-pty required for full PTY features (tab completion, colors) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
keys in VS Code terminal output
Ink renders before masking
word-wrapped across visual lines
Known Limitations
Ink component wrapping)
Test plan
npm run build:all+npm run type-check+npm run lint— all passsk-proj-...key→ fully masked
claudein Shielded Terminal → key masked ininput, response, tab history
🤖 Generated with Claude Code