Skip to content

Fix terminal color support: default TERM=xterm-256color and COLORTERM=truecolor#6

Merged
AnExiledDev merged 2 commits intomainfrom
fix/terminal-color-defaults
Feb 26, 2026
Merged

Fix terminal color support: default TERM=xterm-256color and COLORTERM=truecolor#6
AnExiledDev merged 2 commits intomainfrom
fix/terminal-color-defaults

Conversation

@AnExiledDev
Copy link
Owner

@AnExiledDev AnExiledDev commented Feb 24, 2026

Summary

  • Added TERM=xterm-256color and COLORTERM=truecolor to remoteEnv in devcontainer.json — Docker defaults to TERM=xterm (8 colors) which caused Claude Code and other CLI tools to downgrade rendering
  • Added terminal color defaults to managed shell block in setup-aliases.sh so tmux panes, docker exec, and SSH sessions also get 256-color and truecolor support
  • Updated kitty-terminfo/README.md to reflect container terminal color defaults

Test plan

  • Rebuild container and verify echo $TERM returns xterm-256color
  • Verify echo $COLORTERM returns truecolor
  • Verify tput colors returns 256
  • Open a tmux pane and confirm TERM/COLORTERM are set correctly
  • Run Claude Code and verify full color styling renders

Summary by CodeRabbit

  • Bug Fixes

    • Improved terminal color support: devcontainer sessions now default to xterm-256color with truecolor enabled, ensuring consistent 256-color/24-bit rendering across tmux, docker exec, and SSH entry points.
  • Documentation

    • Added v1.14.3 release notes and updated docs to explain terminal environment behavior and verification guidance.

@coderabbitai
Copy link

coderabbitai bot commented Feb 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6041378 and 0a11296.

📒 Files selected for processing (4)
  • .devcontainer/CHANGELOG.md
  • .devcontainer/CLAUDE.md
  • .devcontainer/devcontainer.json
  • .devcontainer/features/kitty-terminfo/README.md
✅ Files skipped from review due to trivial changes (1)
  • .devcontainer/CLAUDE.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • .devcontainer/CHANGELOG.md
  • .devcontainer/features/kitty-terminfo/README.md

📝 Walkthrough

Walkthrough

Adds TERM and COLORTERM environment forwarding/defaults to the devcontainer configuration and setup script to enable 256-color/truecolor in container sessions, and documents the changes in the CHANGELOG, kitty-terminfo README, and CLAUDE.md.

Changes

Cohort / File(s) Summary
Devcontainer env config
.devcontainer/devcontainer.json
Adds remoteEnv entries: TERM set to "${localEnv:TERM:xterm-256color}" and COLORTERM set to "truecolor".
Shell setup defaults
.devcontainer/scripts/setup-aliases.sh
Sets defaults in managed shell block: if TERM is unset or xterm, set TERM=xterm-256color; ensure COLORTERM=truecolor if not set.
Kitty terminfo docs
.devcontainer/features/kitty-terminfo/README.md
Updates usage notes to explain TERM forwarding behavior, Kitty-specific terminfo effects, and behavior for non-VS Code entry points (tmux, docker exec, SSH).
Changelog & docs
.devcontainer/CHANGELOG.md, .devcontainer/CLAUDE.md
Adds v1.14.3 changelog entry describing Terminal Color Support changes; documents TERM and COLORTERM in environment docs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I hopped into the shell tonight,
Colors blooming in pixels bright,
xterm grows richer, truecolor in sight,
I twitch my whiskers—terminal delight! 🎨✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing terminal color support by setting TERM and COLORTERM defaults, which aligns with all file changes across devcontainer.json, setup-aliases.sh, documentation, and changelog.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/terminal-color-defaults

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.devcontainer/devcontainer.json:
- Around line 13-14: Add documentation for the new remoteEnv terminal defaults:
update .devcontainer/CLAUDE.md (either the "Key Configuration" table or the
"Environment" section) to include entries for TERM (default "xterm-256color")
and COLORTERM (default "truecolor"), mention these are set via the remoteEnv
block in devcontainer.json, and include a short note about why these defaults
are chosen (terminal color support/compatibility).
- Line 13: The devcontainer remoteEnv entry hardcodes "TERM": "xterm-256color",
which overrides a host-forwarded TERM (e.g., xterm-kitty); update the remoteEnv
TERM value to use the VS Code variable substitution
${localEnv:TERM:xterm-256color} so the host TERM is preserved when present and
falls back to xterm-256color otherwise—locate the "TERM" key in the remoteEnv
object in .devcontainer/devcontainer.json and replace its value accordingly.

In @.devcontainer/features/kitty-terminfo/README.md:
- Line 19: Update the README guidance to reflect that VS Code sessions override
TERM via the devcontainer.json remoteEnv setting: either (preferred) change the
devcontainer.json remoteEnv entry for "TERM" to use the variable form
${localEnv:TERM:xterm-256color} so forwarded TERM (e.g., xterm-kitty) is
preserved for VS Code connections, or (if you won't change devcontainer.json)
clarify the README sentence to state that the Kitty forwarding behavior only
applies to non-VS Code entry points because VS Code currently forces "TERM":
"xterm-256color" via remoteEnv.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d2ba55e and 6041378.

📒 Files selected for processing (4)
  • .devcontainer/CHANGELOG.md
  • .devcontainer/devcontainer.json
  • .devcontainer/features/kitty-terminfo/README.md
  • .devcontainer/scripts/setup-aliases.sh

- Use ${localEnv:TERM:xterm-256color} in remoteEnv to preserve host TERM
  (e.g., xterm-kitty) instead of unconditionally overriding it
- Document TERM and COLORTERM in CLAUDE.md Environment section
- Update kitty-terminfo README to clarify VS Code vs non-VS Code behavior
- Update CHANGELOG to reflect all fixes
@AnExiledDev AnExiledDev force-pushed the fix/terminal-color-defaults branch from 0a11296 to 2173291 Compare February 26, 2026 02:46
@AnExiledDev AnExiledDev merged commit 187236f into main Feb 26, 2026
1 check passed
@AnExiledDev AnExiledDev deleted the fix/terminal-color-defaults branch February 26, 2026 02:46
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.

1 participant