From: Plom Heller Date: Sat, 19 Sep 2026 10:45:10 +0000 (+0200) Subject: Fix ls color loss on switching to root. X-Git-Url: https://plomlompom.com/repos/booking/foo.html?a=commitdiff_plain;h=3e21b00f300c9bc15b65543eb4d1781e2c11e1d9;p=confplom Fix ls color loss on switching to root. --- diff --git a/home/any/.profile.d/aliases b/home/any/.profile.d/aliases index f0ff635..77d8158 100644 --- a/home/any/.profile.d/aliases +++ b/home/any/.profile.d/aliases @@ -1,2 +1,7 @@ +# dircolors only knows a terminal via its $TERM or a non-empty $COLORTERM, +# and its database has no entry for foot's TERM=foot. So a shell that has +# lost foot's COLORTERM=truecolor (e.g. root's, via "su -l", which keeps only +# TERM) gets no LS_COLORS and hence no ls colors. Fill it in with a forced +# COLORTERM in that case; an existing LS_COLORS is left alone. +[ -n "${LS_COLORS}" ] || eval "$(COLORTERM=${COLORTERM:-truecolor} dircolors -b)" alias ls="ls --color=auto" -