Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"--hostname", "cpp-devcontainer",
"--name", "cpp-dev-${localEnv:USER}",
"--env", "DISPLAY=${localEnv:DISPLAY}",
"--env", "TERM=xterm-256color",
Copy link

Copilot AI Dec 20, 2025

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.

Suggested change
"--env", "TERM=xterm-256color",
"--env", "TERM=xterm-256color",

Copilot uses AI. Check for mistakes.
"--volume", "/tmp/.X11-unix:/tmp/.X11-unix",
"--gpus", "all"
// TODO: Analyze if needed
Expand Down
28 changes: 23 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Copilot AI Dec 20, 2025

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.

Suggested change
# 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.

Copilot uses AI. Check for mistakes.
# Uncommenting the line below forces colors unconditionally, bypassing detection.
# This ensures colors work even if TERM isn't properly set, or in non-interactive
# contexts. Safe for modern environments like Ubuntu 22.04/24.04.
#
# Only downside: may show escape codes on very old terminals without color support.
# ------------------------------------------------------------------------------
RUN echo 'export PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ "' >> /home/ubuntu/.bashrc \
&& echo 'alias ls="ls --color=auto"' >> /home/ubuntu/.bashrc \
&& echo 'alias grep="grep --color=auto"' >> /home/ubuntu/.bashrc
# RUN sed -i 's/^#force_color_prompt=yes/force_color_prompt=yes/' /home/ubuntu/.bashrc

# -----------------------------------------------------------------------------
# Install pre-commit for code quality checks
Expand Down
1 change: 1 addition & 0 deletions scripts/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Copy link

Copilot AI Dec 20, 2025

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"

Suggested change
--env TERM=xterm-256color \
--env "TERM=xterm-256color" \

Copilot uses AI. Check for mistakes.
--volume /tmp/.X11-unix:/tmp/.X11-unix \
--volume "$PROJECT_ROOT:/workspaces/$PROJECT_NAME" \
--gpus all \
Expand Down