Manipulate terminal session background color

Greetings,

I know I can manipulate from AppleScript to terminal.app or just run commands from apple script.

But what about from a BASH Script.

when A user logs in and runs a maintenance utility I have written for them, I want to modify their background color and text color.

example;

#!/bin/bash
clear
bold=`tput smso`
offbold=`tput rmso`
	echo -e "\033[33;33m fo034 \033[33;40m User Mail Is \033[31;5m ${bold} NOT ACTIVE ${offbold} \033[31;0m"
	echo -e "\033[33;33m fo035            \033[31;5m  Error in Account  \033[31;0m"
	echo -e " now thats some kung f00 "

I want to Change the background color of his terminal session. Lets say " white Text on Black Screen, not just ||||||||| blacked out lines.
How can I manipulate the terminal screen color ?

Change background color then clear the screen(using the 'clear' utility, or 'tput clear'), that should set the entire window.

---------- Post updated at 08:47 AM ---------- Previous update was at 08:43 AM ----------

\033[33;33m

This seems redundant -- you're setting the same foreground color twice. 3x is foreground color, 4x is background color. 1 makes the foreground extra bright.

Try

printf "\033[1;33;43m" ; clear

bright yellow on dark yellow.

printf "\033[0;30;47m" ; clear

white background on black text. I don't think you can make the background brighter.

printf is more portable than echo -e -- echo -e is mostly a linux thing.

Thanks,

Im guessing there is not way to change the whole screen in one shot. the Code above works line by line, changing the background color of the lines Im working on.

No problem, using this code will work just fine, thanks.

That's what the 'clear' is for.

If it doesn't work, your prompt may be changing the color back on you.

pls :smiley: Change the background color