Skip to content

Show Claude icon in terminal header while Claude Code is active#3046

Open
Copilot wants to merge 7 commits intomainfrom
copilot/add-header-icon-for-claude
Open

Show Claude icon in terminal header while Claude Code is active#3046
Copilot wants to merge 7 commits intomainfrom
copilot/add-header-icon-for-claude

Conversation

Copy link
Contributor

Copilot AI commented Mar 12, 2026

This updates the terminal shell-integration badge so it reflects Claude Code activity instead of always rendering the generic AI icon. When the active shell command is Claude Code, the header now shows the Claude logo.

  • Terminal shell-integration badge

    • Updated getShellIntegrationIconButton() to render the Claude logo while Claude Code is the active running command.
    • Kept the existing shell-integration states and messaging intact for non-Claude commands.
  • Claude Code detection

    • Added command detection for Claude Code in the OSC shell-integration flow.
    • Tracks active Claude sessions on TermWrap, including initial runtime-info hydration and command lifecycle transitions.
    • Handles common invocation forms, including direct binary paths and commands wrapped by env var assignments / env.
  • UI rendering

    • Added @lobehub/icons and used its Claude icon in the terminal header path.
    • Reused the existing icon-button rendering contract by passing a React node for the icon where needed.
  • Focused coverage

    • Added a small unit test for Claude command detection to lock in the supported command forms.
const claudeCodeActive = get(this.termRef.current.claudeCodeActiveAtom);
const icon = claudeCodeActive ? React.createElement(TermClaudeIcon) : "sparkles";
  • screenshot
    • Claude terminal header badge

💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 12, 2026

Deploying waveterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3f30447
Status: ✅  Deploy successful!
Preview URL: https://25ec6d9a.waveterm.pages.dev
Branch Preview URL: https://copilot-add-header-icon-for.waveterm.pages.dev

View logs

Copilot AI and others added 2 commits March 12, 2026 21:57
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Copilot AI changed the title [WIP] Add header icon for Claude logo in term wrap Show Claude icon in terminal header while Claude Code is active Mar 12, 2026
Copilot AI requested a review from sawka March 12, 2026 22:05
@sawka sawka marked this pull request as ready for review March 13, 2026 00:55
@kilo-code-bot
Copy link
Contributor

kilo-code-bot bot commented Mar 13, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (7 files)
  • frontend/app/asset/claude-color.svg - New Claude icon asset
  • frontend/app/view/term/osc-handlers.test.ts - Tests for Claude Code detection
  • frontend/app/view/term/osc-handlers.ts - Claude Code command detection with proper regex and normalization
  • frontend/app/view/term/term-model.ts - UI updates for Claude icon display
  • frontend/app/view/term/term.tsx - New TermClaudeIcon component
  • frontend/app/view/term/termwrap.ts - State management for Claude Code detection
  • package-lock.json - Dependency updates

The PR implements Claude Code detection and display:

  • Uses regex /(?:^|\/ )claude\b/ to detect Claude Code commands including paths like /usr/local/bin/claude
  • Normalizes commands by stripping environment variable prefixes and "env " prefix
  • Displays a Claude-colored icon when Claude Code is detected running in the terminal
  • Updates the status title to "Claude Code Detected" when appropriate
  • Tests cover direct invocations, env-wrapped invocations, and correctly ignore non-Claude commands

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