diff --git a/.devcontainer/CHANGELOG.md b/.devcontainer/CHANGELOG.md index a56f290..5126979 100644 --- a/.devcontainer/CHANGELOG.md +++ b/.devcontainer/CHANGELOG.md @@ -10,6 +10,13 @@ #### 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` 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 `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 #### VS Code Extensions 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 888969b..27226fd 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": "${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 fd2dde0..af5f3c9 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: 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 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"