Skip to content

Commit d6ecb94

Browse files
authored
Merge pull request #12 from DiamondLightSource/ls-colors
Add ls colors
2 parents 18a60ce + 50681fa commit d6ecb94

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.devcontainer/features/bash-config/config/bash-config-rc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ __bash_prompt() {
3636
__bash_prompt
3737
export PROMPT_DIRTRIM=4
3838

39+
# colorize ls output
40+
export LS_OPTIONS='--color=auto'
41+
eval "$(dircolors)"
42+
alias ls='ls $LS_OPTIONS'
43+
alias ll='ls $LS_OPTIONS -l'
44+
3945
# enable bash completion for git
4046
if [[ -f /usr/share/bash-completion/completions/git ]]; then
4147
source /usr/share/bash-completion/completions/git

test/bash-config/test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ source dev-container-features-test-lib
1111
# The 'check' command comes from the dev-container-features-test-lib. Syntax is...
1212
# check <LABEL> <cmd> [args...]
1313
check "execute command" bash -c "test $HISTFILE == $CONFIG_FOLDER/.bash_eternal_history"
14+
check "ls colors" bash -c "test $LS_OPTIONS == --color=auto"
1415

1516
# Report results
1617
# If any of the checks above exited with a non-zero exit code, the test will fail.

0 commit comments

Comments
 (0)