-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
Currently, .bashrc forcibly enforces color settings via the Dockerfile (PS1, ls and grep color aliases) unconditionally. This adds color everywhere, which breaks output in CI, scripts, non-interactive processes, and non-xterm shells. It's not robust and diverges from best-practices in Docker/terminal config.
Reference: Lines 51–53 in Dockerfile
Proposal
- Remove unconditional color aliases and PS1 settings from Docker instructions.
- Instead, emit a shell block in
.bashrcthat checks for interactive xterm-like terminals only:# Color prompt and aliases only for interactive xterm-like terminals case "$-" in *i*) case "$TERM" in xterm*|screen*|tmux*) export IS_XTERM=1 export PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ " alias ls="ls --color=auto" alias grep="grep --color=auto" ;; esac ;; esac
IS_XTERMcan then be consumed by other scripts/config to enable xterm-dependent features cleanly.
Motivation
- Prevents color output from polluting logs and scripts in CI/headless/non-terminal.
- Leans on a documented, community-tested approach for terminal detection in dotfiles.
- Dockerfile remains clear, minimal, and easy to maintain.
(Optional) Further improvements
- Consider using
/etc/skel/.bashrcas template for new users for consistency. - Consider making the entire colored PS1 optional via build argument or environment variable.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request