From 65552bdcd5acaa04e29d7349852082abdb7ec92c Mon Sep 17 00:00:00 2001 From: AnExiledDev Date: Tue, 24 Feb 2026 23:10:43 +0000 Subject: [PATCH 1/2] Fix terminal color support: default TERM=xterm-256color and COLORTERM=truecolor --- .devcontainer/CHANGELOG.md | 5 +++++ .devcontainer/devcontainer.json | 2 ++ .devcontainer/features/kitty-terminfo/README.md | 4 +++- .devcontainer/scripts/setup-aliases.sh | 6 ++++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.devcontainer/CHANGELOG.md b/.devcontainer/CHANGELOG.md index a56f290..7971aa4 100644 --- a/.devcontainer/CHANGELOG.md +++ b/.devcontainer/CHANGELOG.md @@ -10,6 +10,11 @@ #### ChromaTerm - **Regex lookbehinds** — replaced alternation inside lookbehinds (`(?<=[\s(]|^)` and `(?<=commit |merge |...)`) with non-capturing groups containing individual lookbehinds (`(?:(?<=[\s(])|^)` and `(?:(?<=commit )|(?<=merge )|...)`) for PCRE2 compatibility +#### Terminal Color Support +- **devcontainer.json** — added `TERM=xterm-256color` and `COLORTERM=truecolor` to `remoteEnv`; Docker defaults to `TERM=xterm` (8 colors) which caused Claude Code and other CLI tools to downgrade rendering +- **setup-aliases.sh** — added terminal color defaults to managed shell block so tmux panes, `docker exec`, and SSH sessions also get 256-color and truecolor support +- **kitty-terminfo/README.md** — updated documentation to reflect container terminal color defaults + ### Removed #### VS Code Extensions diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 888969b..44349b0 100755 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -10,6 +10,8 @@ "CLAUDE_CONFIG_DIR": "/workspaces/.claude", "GH_CONFIG_DIR": "/workspaces/.gh", "TMPDIR": "/workspaces/.tmp", + "TERM": "xterm-256color", + "COLORTERM": "truecolor", "CLAUDECODE": null }, diff --git a/.devcontainer/features/kitty-terminfo/README.md b/.devcontainer/features/kitty-terminfo/README.md index fd2dde0..8b54d5b 100644 --- a/.devcontainer/features/kitty-terminfo/README.md +++ b/.devcontainer/features/kitty-terminfo/README.md @@ -14,7 +14,9 @@ Downloads and compiles the official kitty terminfo entry from the [Kitty termina ## Usage -No configuration needed. Once installed, containers automatically recognize `TERM=xterm-kitty` and provide full capability support. +The container defaults to `TERM=xterm-256color` with `COLORTERM=truecolor`, which provides full 256-color and 24-bit truecolor support for all terminals. + +For Kitty users: if your host terminal forwards `TERM=xterm-kitty` into the container, the installed terminfo ensures full Kitty-specific capability support (correct `bce` behavior, status line, etc.). If not forwarded, `xterm-256color` provides equivalent color rendering. ```bash # Verify installation diff --git a/.devcontainer/scripts/setup-aliases.sh b/.devcontainer/scripts/setup-aliases.sh index 3e15818..532619a 100755 --- a/.devcontainer/scripts/setup-aliases.sh +++ b/.devcontainer/scripts/setup-aliases.sh @@ -74,6 +74,12 @@ export GH_CONFIG_DIR="${GH_CONFIG_DIR:-/workspaces/.gh}" export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8 +# Terminal color defaults — Docker sets TERM=xterm (8 colors); upgrade to 256-color +if [ "\$TERM" = "xterm" ] || [ -z "\$TERM" ]; then + export TERM=xterm-256color +fi +export COLORTERM="\${COLORTERM:-truecolor}" + # Prefer native binary over npm-installed version if [ -x "\$HOME/.local/bin/claude" ]; then _CLAUDE_BIN="\$HOME/.local/bin/claude" From 217329183fae552c5a7ec81942d14daa00a439fb Mon Sep 17 00:00:00 2001 From: AnExiledDev Date: Wed, 25 Feb 2026 05:15:42 +0000 Subject: [PATCH 2/2] Fix CodeRabbit review issues: localEnv forwarding, docs, README accuracy - 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 --- .devcontainer/CHANGELOG.md | 6 ++++-- .devcontainer/CLAUDE.md | 2 ++ .devcontainer/devcontainer.json | 2 +- .devcontainer/features/kitty-terminfo/README.md | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.devcontainer/CHANGELOG.md b/.devcontainer/CHANGELOG.md index 7971aa4..5126979 100644 --- a/.devcontainer/CHANGELOG.md +++ b/.devcontainer/CHANGELOG.md @@ -11,9 +11,11 @@ - **Regex lookbehinds** — replaced alternation inside lookbehinds (`(?<=[\s(]|^)` and `(?<=commit |merge |...)`) with non-capturing groups containing individual lookbehinds (`(?:(?<=[\s(])|^)` and `(?:(?<=commit )|(?<=merge )|...)`) for PCRE2 compatibility #### Terminal Color Support -- **devcontainer.json** — added `TERM=xterm-256color` and `COLORTERM=truecolor` to `remoteEnv`; Docker defaults to `TERM=xterm` (8 colors) which caused Claude Code and other CLI tools to downgrade rendering +- **devcontainer.json** — added `TERM` and `COLORTERM=truecolor` to `remoteEnv`; Docker defaults to `TERM=xterm` (8 colors) which caused Claude Code and other CLI tools to downgrade rendering +- **devcontainer.json** — `TERM` uses `${localEnv:TERM:xterm-256color}` to forward the host terminal type (e.g., `xterm-kitty`) instead of unconditionally overriding it - **setup-aliases.sh** — added terminal color defaults to managed shell block so tmux panes, `docker exec`, and SSH sessions also get 256-color and truecolor support -- **kitty-terminfo/README.md** — updated documentation to reflect container terminal color defaults +- **kitty-terminfo/README.md** — updated documentation to reflect `localEnv` forwarding and clarify behavior across VS Code vs non-VS Code entry points +- **CLAUDE.md** — documented `TERM` and `COLORTERM` environment variables in the Environment section ### Removed diff --git a/.devcontainer/CLAUDE.md b/.devcontainer/CLAUDE.md index dcfa5f1..9df168b 100644 --- a/.devcontainer/CLAUDE.md +++ b/.devcontainer/CLAUDE.md @@ -79,6 +79,8 @@ Rules in `config/defaults/rules/` deploy to `.claude/rules/` on every container | `CLAUDE_CONFIG_DIR` | `/workspaces/.claude` | | `ANTHROPIC_MODEL` | `claude-opus-4-6` | | `WORKSPACE_ROOT` | `/workspaces` | +| `TERM` | `${localEnv:TERM:xterm-256color}` (via `remoteEnv` — forwards host TERM, falls back to 256-color) | +| `COLORTERM` | `truecolor` (via `remoteEnv` — enables 24-bit color support) | All experimental feature flags are in `settings.json` under `env`. Setup steps controlled by boolean flags in `.env`. diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 44349b0..27226fd 100755 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -10,7 +10,7 @@ "CLAUDE_CONFIG_DIR": "/workspaces/.claude", "GH_CONFIG_DIR": "/workspaces/.gh", "TMPDIR": "/workspaces/.tmp", - "TERM": "xterm-256color", + "TERM": "${localEnv:TERM:xterm-256color}", "COLORTERM": "truecolor", "CLAUDECODE": null }, diff --git a/.devcontainer/features/kitty-terminfo/README.md b/.devcontainer/features/kitty-terminfo/README.md index 8b54d5b..af5f3c9 100644 --- a/.devcontainer/features/kitty-terminfo/README.md +++ b/.devcontainer/features/kitty-terminfo/README.md @@ -16,7 +16,7 @@ Downloads and compiles the official kitty terminfo entry from the [Kitty termina The container defaults to `TERM=xterm-256color` with `COLORTERM=truecolor`, which provides full 256-color and 24-bit truecolor support for all terminals. -For Kitty users: if your host terminal forwards `TERM=xterm-kitty` into the container, the installed terminfo ensures full Kitty-specific capability support (correct `bce` behavior, status line, etc.). If not forwarded, `xterm-256color` provides equivalent color rendering. +For Kitty users: the `devcontainer.json` `remoteEnv` uses `${localEnv:TERM:xterm-256color}`, which forwards your host `TERM` into VS Code sessions. If your host sets `TERM=xterm-kitty`, the installed terminfo ensures full Kitty-specific capability support (correct `bce` behavior, status line, etc.). For non-VS Code entry points (tmux, `docker exec`, SSH), `setup-aliases.sh` upgrades `TERM=xterm` to `xterm-256color` but preserves any other value. If no Kitty TERM is forwarded, `xterm-256color` provides equivalent color rendering. ```bash # Verify installation