fix: preserve TERM_PROGRAM for claude-teams to prevent crash
Closed
BO
5mo ago+47+47+01234567890123456789-40-40-01234567890123456789
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
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
unsetTermProgramflag inagentConfigto manageTERM_PROGRAMper agent. - Preserve
TERM_PROGRAMforclaude-teams; unset it foromo,omx, andomcto avoid UI issues. - Default
TERMtoxterm-ghostty; setCOLORTERM=truecolorwhen missing.
- Added
Summary by CodeRabbit
- Chores
- Updated internal terminal environment variable configuration handling for improved consistency across different relay types.