fix: preserve TERM_PROGRAM for claude-teams to prevent crash

Closed
BO
5mo ago
+47-40

Summary

Fixes cmux crash when using claude-teams with teamCreate (issue #2947).

Root Cause

Claude Code v2.1.112 changed how it handles permission escalation based on terminal environment variables. The previous code unconditionally unset which caused Claude Code's cli.js to crash during checks.

Changes

  • Go code ():
    • Add flag to to control handling per agent type
    • : preserve (needed for Ghostty detection in Claude Code)
    • //: unset (opencode switches to light theme when it sees )
    • Change default from to
    • Add for proper truecolor support

Testing

The existing test suite covers claude-teams environment configuration. This fix addresses the specific crash that occurs during permission escalation from teammate to team lead.

Related

  • Issue: #2947
  • Related PR: #2516 (similar fix for color degradation)

Summary by cubic

Prevented a crash in claude-teams during teamCreate by preserving TERM_PROGRAM, and added per-agent control of terminal env vars. Also set safer defaults to improve color support. Fixes #2947.

  • Bug Fixes
    • Added unsetTermProgram flag in agentConfig to manage TERM_PROGRAM per agent.
    • Preserve TERM_PROGRAM for claude-teams; unset it for omo, omx, and omc to avoid UI issues.
    • Default TERM to xterm-ghostty; set COLORTERM=truecolor when missing.

Summary by CodeRabbit

  • Chores
    • Updated internal terminal environment variable configuration handling for improved consistency across different relay types.