Changing terminal text color

image_pdfimage_print

Our ecommerce platform, Hybris, really enjoys colorizing the logs. So whenever I read the logs, it changes the text color of my terminal. Contrary to popular belief, red on black is not very readable.

This command will set the text back to white (on black background):

tput setaf 7

More info can be found my typing ‘man terminfo’ and searching for ‘Color Handling’

Color #define Value RGB

black COLOR_BLACK 0 0, 0, 0
red COLOR_RED 1 max,0,0
green COLOR_GREEN 2 0,max,0
yellow COLOR_YELLOW 3 max,max,0
blue COLOR_BLUE 4 0,0,max
magenta COLOR_MAGENTA 5 max,0,max
cyan COLOR_CYAN 6 0,max,max
white COLOR_WHITE 7 max,max,max

Leave a Reply

Your email address will not be published. Required fields are marked *

Comments Protected by WP-SpamShield Spam Blocker