-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add TERM environment variable for enhanced terminal color support #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request enhances the developer experience in the C++ devcontainer by adding consistent terminal color support through the TERM=xterm-256color environment variable and improving documentation around user management for Ubuntu base images.
Key Changes:
- Added
TERM=xterm-256colorenvironment variable to both Docker run script and devcontainer configuration for enhanced 256-color terminal support - Expanded Dockerfile documentation to clarify user creation logic, UID/GID remapping behavior, and rationale for using the hardcoded 'ubuntu' user
- Replaced explicit bash color configuration commands with an optional commented approach that leverages Ubuntu's built-in color detection
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| scripts/docker/run.sh | Added TERM=xterm-256color environment variable to docker run command for color support |
| Dockerfile | Enhanced documentation for user creation/management logic and updated bash color configuration approach with detailed explanations |
| .devcontainer/devcontainer.json | Added TERM=xterm-256color to runArgs for consistent color support in VS Code devcontainer |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| --env "HOST_UID=$(id -u)" \ | ||
| --env "HOST_GID=$(id -g)" \ | ||
| --env "DISPLAY=${DISPLAY}" \ | ||
| --env TERM=xterm-256color \ |
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent quoting style for environment variable. Other --env declarations on lines 28-30 use quotes around the variable assignment (e.g., "HOST_UID=$(id -u)"). For consistency, this should be: --env "TERM=xterm-256color"
| --env TERM=xterm-256color \ | |
| --env "TERM=xterm-256color" \ |
| "--hostname", "cpp-devcontainer", | ||
| "--name", "cpp-dev-${localEnv:USER}", | ||
| "--env", "DISPLAY=${localEnv:DISPLAY}", | ||
| "--env", "TERM=xterm-256color", |
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected at the end of this line. Please remove the space after the comma.
| "--env", "TERM=xterm-256color", | |
| "--env", "TERM=xterm-256color", |
| # defaults to "xterm" which lacks color support. Setting TERM=xterm-256color | ||
| # enables Ubuntu's .bashrc auto-detection to recognize and use colors. | ||
| # |
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The statement that TERM defaults to "xterm" which lacks color support is inaccurate. The standard "xterm" terminal type does support colors (8 colors). The difference is that "xterm-256color" provides 256-color support rather than just 8 colors. Consider revising this to clarify that the issue is about enhanced color support (256 colors) rather than implying "xterm" has no color support at all.
| # defaults to "xterm" which lacks color support. Setting TERM=xterm-256color | |
| # enables Ubuntu's .bashrc auto-detection to recognize and use colors. | |
| # | |
| # typically defaults to "xterm", which has basic 8-color support. Setting | |
| # TERM=xterm-256color enables enhanced 256-color support and helps Ubuntu's | |
| # .bashrc auto-detection recognize and use richer colors. |
Description
This pull request improves the developer experience in the C++ devcontainer by ensuring consistent terminal color support and clarifying user creation logic for Ubuntu base images. The changes primarily focus on environment configuration and documentation for user management.
Terminal color support improvements:
TERM=xterm-256colorto both the Docker run script (run.sh) and the devcontainer configuration (devcontainer.json) to ensure colored terminal prompts and proper color support in shells and tools. [1] [2]Dockerfileto explain howTERM=xterm-256colorenables colored prompts and how to force color prompt in.bashrcif needed, making the setup robust for modern environments.User management and documentation:
Dockerfileto clarify the rationale for always using theubuntuuser (UID 1000) for compatibility with both Ubuntu 22.04 and 24.04, and explained how UID/GID remapping works at runtime.ubuntuuser, making the setup and permissions clearer for future maintainers.