How to turn off colors in terminal?

Having issues with your DietPi installation or found a bug? Post it here.
John Long
Posts: 22
Joined: Tue Jun 29, 2021 11:17 pm

How to turn off colors in terminal?

Post by John Long »

Hi,

Sorry for another n00b question. I'm running the latest dietpi on a 4B, headless. I use ssh from a Linux box.

On my Linux box, the terminal is monochrome. When I ssh to the dietpi box there are colors in the terminal. For my eyes the colors are difficult to see, especially the cpu temp...it's yellow and completely invisible to me.

I'd like a standard black and white terminal, call me Old Skool :D

I have to say, I don't remember seeing colors on any other OS although I may have fixed it long ago in some config file that I keep copying around to all the new boxes I bring up.

What am I missing? Thank you.
User avatar
Joulinar
Posts: 5147
Joined: Sat Nov 16, 2019 12:49 am

Re: How to turn off colors in terminal?

Post by Joulinar »

Hi,

as far as I can see, colour scheme for CPU temp is hardcode in /boot/dietpi/func/dietpi-globals

This is the code section https://github.com/MichaIng/DietPi/blob ... 1470-L1504
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
John Long
Posts: 22
Joined: Tue Jun 29, 2021 11:17 pm

Re: How to turn off colors in terminal?

Post by John Long »

Thank you, I will look at that.

But really I want to change the terminal to monochrome all the time, not just for the motd.
User avatar
Joulinar
Posts: 5147
Joined: Sat Nov 16, 2019 12:49 am

Re: How to turn off colors in terminal?

Post by Joulinar »

well the colour are defined inside the scripts.

@MichaIng
FYI, probably something for a later enhancement to allow user defined colours ?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
John Long
Posts: 22
Joined: Tue Jun 29, 2021 11:17 pm

Re: How to turn off colors in terminal?

Post by John Long »

I'm sorry, I mean there should be a way to set a TERM that works yet does not support color. Or maybe some way to tell xterm not to display colors. The popup menu settings didn't show anything promising aside from one item which I unchecked, but it didn't change anything.

Thank you, I don't expect you guys to change any code for me. I realize most people either want color or don't care.

For us old greybeards, we often can't see anything so we like black text on a white background. It's just odd that I never ran into this or like I said maybe I fixed it with some config somewhere decades ago and just copied it to every new box and now I can't remember how I fixed it.
John Long
Posts: 22
Joined: Tue Jun 29, 2021 11:17 pm

Re: How to turn off colors in terminal?

Post by John Long »

Ok, xterm -cm seems to help... lemme go with that for now. This is actually quite a nice solution for me since BOLD works and text flashes, just no color :)

Thanks a lot again, for your time and friendly helpfulness :)
User avatar
MichaIng
Site Admin
Posts: 3106
Joined: Sat Nov 18, 2017 6:21 pm

Re: How to turn off colors in terminal?

Post by MichaIng »

The colours of the login banner can be adjusted in /boot/dietpi/.dietpi-banner: https://github.com/MichaIng/DietPi/blob ... er#L72-L75

Code: Select all

aCOLOR[0]	'\e[38;5;154m'	# DietPi green	| Lines, bullets and separators
aCOLOR[1]	'\e[1m'		# Bold white	| Main descriptions
aCOLOR[2]	'\e[90m'	# Grey		| Credits
aCOLOR[3]	'\e[91m'	# Red		| Update notifications
I wanted to allow this DietPi-wide since a while: https://github.com/MichaIng/DietPi/issues/2651
Also the notification/message print function has it's colours prepared as variables already, to allow removing them for systemd services and cron jobs (else raw colour codes are in logs). Please feel free to share some input/ideas on the pull request.
John Long
Posts: 22
Joined: Tue Jun 29, 2021 11:17 pm

Re: How to turn off colors in terminal?

Post by John Long »

Thank you, Michal. I see the problem when I use the dietpi tools but my issue is not specific to those. I just want a monochrome terminal all the time.

I'm using xterm -cm for now on my host, it seems mostly ok. I need to tune the options a bit.

Thanks for looking into this. :)
User avatar
trendy
Posts: 343
Joined: Tue Feb 25, 2020 2:54 pm

Re: How to turn off colors in terminal?

Post by trendy »

This is a setting that can be adjusted on the client. For example in SecureCRT if I deselect the ANSI colour, then the terminal stays monochrome, both motd and the prompt. So you can look at the settings of the terminal emulator you are using.
User avatar
Joulinar
Posts: 5147
Joined: Sat Nov 16, 2019 12:49 am

Re: How to turn off colors in terminal?

Post by Joulinar »

same for Putty. There you could deselect colours and screen stays monochrome as well.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply