-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -34,23 +34,41 @@ RUN apt-get update && apt-get install -y \ | |||||||||||||
|
|
||||||||||||||
| # ------------------------------------------------------------------------------ | ||||||||||||||
| # Create 'ubuntu' user if it doesn't exist (for Ubuntu 22.04 compatibility) | ||||||||||||||
| # | ||||||||||||||
| # Ubuntu 24.04 already includes this user; Ubuntu 22.04 does not. | ||||||||||||||
| # UID/GID will be remapped at runtime by entrypoint.sh to match host. | ||||||||||||||
| # | ||||||||||||||
| # IMPORTANT: We hardcode 'ubuntu' to avoid UID conflicts: | ||||||||||||||
| # - Ubuntu base images already have an 'ubuntu' user at UID 1000 | ||||||||||||||
| # - If we used a different username and tried to create it with UID 1000, | ||||||||||||||
| # the 'useradd' command would fail due to UID conflict | ||||||||||||||
| # - Runtime remapping (via usermod) changes the numeric UID/GID, not the name | ||||||||||||||
| # - File permissions use numeric UIDs, so the username is just a label | ||||||||||||||
| # ------------------------------------------------------------------------------ | ||||||||||||||
| RUN if ! id -u ubuntu > /dev/null 2>&1; then \ | ||||||||||||||
| useradd -m -s /bin/bash -u 1000 ubuntu; \ | ||||||||||||||
| fi | ||||||||||||||
|
|
||||||||||||||
| # ------------------------------------------------------------------------------ | ||||||||||||||
| # Configure the 'ubuntu' user (UID/GID will be remapped at runtime) | ||||||||||||||
| # Configure sudo access for ubuntu user | ||||||||||||||
| # ------------------------------------------------------------------------------ | ||||||||||||||
| RUN echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/ubuntu \ | ||||||||||||||
| && chmod 0440 /etc/sudoers.d/ubuntu | ||||||||||||||
|
|
||||||||||||||
| # ------------------------------------------------------------------------------ | ||||||||||||||
| # Configure bash with colors for ubuntu user | ||||||||||||||
| # Enable colored terminal prompts (OPTIONAL - forces colors unconditionally) | ||||||||||||||
| # | ||||||||||||||
| # Without TERM=xterm-256color (set in run.sh and devcontainer.json), TERM | ||||||||||||||
| # defaults to "xterm" which lacks color support. Setting TERM=xterm-256color | ||||||||||||||
| # enables Ubuntu's .bashrc auto-detection to recognize and use colors. | ||||||||||||||
| # | ||||||||||||||
|
Comment on lines
+62
to
+64
|
||||||||||||||
| # 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. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -28,6 +28,7 @@ docker run --rm -it \ | |||||
| --env "HOST_UID=$(id -u)" \ | ||||||
| --env "HOST_GID=$(id -g)" \ | ||||||
| --env "DISPLAY=${DISPLAY}" \ | ||||||
| --env TERM=xterm-256color \ | ||||||
|
||||||
| --env TERM=xterm-256color \ | |
| --env "TERM=xterm-256color" \ |
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.