BSP 6.4.0 minimal serial console colors

To my surprise htop became black and white. dmesg from util-linux as well became BW by default. I’m not familiar with all consoles and terminal nuisances. What can I do to restore colors?

Update:
echo $TERM returns vt220. I see serial-getty@.service is different, older one sets TERM=xterm, and a new one leaves it unset. So one of solutions could be bbappend something to patch serial-getty@.service. Or perhaps the more right way creating override file for serial-getty@.service with TERM set, like suggested here. Seems working.

Hi @Edward !

Thanks for reporting!

When logging in via serial (e.g. using Minicom), I was able to reproduce it. The default for TERM was vt220. In this case, htop and dmesg was black and white. htop was still using bold to highlight some stuff.

After executing export TERM=xterm, htop became colorful, but dmesg remained colorless.

But, when logging via ssh, TERM was screen-256color and htop was colorful. dmesg again was colorless.

dmesg is part of busybox, which does not seem to be implemented with color. So, if you need colorful dmesg, you will need to add util-linux to your build (which seems like you are already doing).

Instead of modifying the serial-getty@.service, you can also:

  • add TERM=<terminal> to your /etc/profile, or
  • add export TERM=<terminal> to your ~/.bashrc

The possible <terminal> values can be found in /etc/terminfo:

root@colibri-imx7-emmc-06674596:~# find /etc/terminfo/
/etc/terminfo/
/etc/terminfo/s
/etc/terminfo/s/screen
/etc/terminfo/s/screen-256color
/etc/terminfo/s/sun
/etc/terminfo/d
/etc/terminfo/d/dumb
/etc/terminfo/a
/etc/terminfo/a/ansi
/etc/terminfo/r
/etc/terminfo/r/rxvt
/etc/terminfo/x
/etc/terminfo/x/xterm-256color
/etc/terminfo/x/xterm-color
/etc/terminfo/x/xterm-xfree86
/etc/terminfo/x/xterm
/etc/terminfo/v
/etc/terminfo/v/vt200
/etc/terminfo/v/vt100
/etc/terminfo/v/vt52
/etc/terminfo/v/vt102
/etc/terminfo/v/vt220
/etc/terminfo/l
/etc/terminfo/l/linux

Also, from the StackOverflow link you shared:

So seems like systemd caused this change.

Best regards,