@@ -84,6 +84,15 @@
8484 # No welcome banner.
8585 set -g fish_greeting
8686
87+ # The container runtime hands fish a bare TERM=xterm (8 colors) and
88+ # no COLORTERM, washing out colors. The bundled terminfo DB (via
89+ # ncurses) has the 256-color entry, so promote xterm→xterm-256color
90+ # and advertise truecolor for 24-bit-aware tools.
91+ if test "$TERM" = xterm; or test -z "$TERM"
92+ set -gx TERM xterm-256color
93+ end
94+ set -q COLORTERM; or set -gx COLORTERM truecolor
95+
8796 # Define the prompt as a function so fish renders it before every
8897 # command; at top level it would run once at startup and be ignored.
8998 function fish_prompt
@@ -174,6 +183,10 @@
174183 "HOME=/root"
175184 # Marker so shells/scripts can detect they're in here.
176185 "NIX_CONTAINER=1"
186+ # Advertise truecolor so `container exec` sessions (which don't
187+ # source the fish init) still get 24-bit color. TERM is fixed up
188+ # in the fish prompt init, since the runtime overrides it here.
189+ "COLORTERM=truecolor"
177190 # CA trust for every TLS client (curl/git/…) and Nix.
178191 "SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt"
179192 "NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt"