Bash dialog menu - colors

hello,
how can i put colors in dialog menus?

dialog  --title "some title" \
        --menu "\n        Use arrows - UP/DOWN \n\
        Press [Enter] to select\n" 20 40 10 \
        "1"       "Choose the psybnc port"\

how can i make 'Choose the psybnc port' green or something ?
thanx

rares_dumitrescuAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rares_dumitrescuAuthor Commented:
is it possible or not ?:)
and if it is .. how ?
0
ozoCommented:
if you are on an ANSI terminal, try inserting <escape>[32m to turn on green <escape>[0m to turn off colours
0
rares_dumitrescuAuthor Commented:
dialog  --title "EvoPanel - getmuh v1.5" \
        --menu "\n        Use arrows - UP/DOWN.\n\
        Press [Enter] to select.\n" 21 45 10 \
        "GO"      "<escape>[32mStart installation"\

But it does not work .. it does not change the collor :|

0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

ozoCommented:
What does it do
How did you insert the <escape> character?
0
rares_dumitrescuAuthor Commented:
sorry i am bothering you so much, i am learning this things on the way
i am writing this scripts in ssh (putty) so .. how should i insert <escape>[32m ?
thanx
0
ozoCommented:
perl -i -pe 's/<escape>/\e/g' script
would convert "<escape>" strings in script to  escape characters (which I can't cut and paste into this comment
0
rares_dumitrescuAuthor Commented:
that perl -i -pe .. made the script like this:
        "GO"      "^[[32mStart installation"\

so the <escape> was converted into ^[ .. but it still didn't change the color, when i execute it it just appears ^[[32mStart installation
0
rares_dumitrescuAuthor Commented:
anyone ? :D
0
Duncan RoeSoftware DeveloperCommented:
Do you have the dialog man page? I.e. do you get useful output from the command "man dialog"? Even if not, you can probably fina a man page from Google.
Dialog implements ANSI colours using embedded "\Z" sequences. You need to ensure the terminal type you set in the remote host matches putty's emulation.
0
rares_dumitrescuAuthor Commented:
yea, but i still want an answer on how to set collors :)
0
Duncan RoeSoftware DeveloperCommented:
The man page tells you how to do it - you should try reading it :)
In brief: include the option '--colors" on the command line. Then, to set the colour of a string, e.g. "\Zb\Z1" makes the following text bright red.
RTFM!
0
Duncan RoeSoftware DeveloperCommented:
When reading the man page, you can save yourself some time by searching for the string "color"
0
Duncan RoeSoftware DeveloperCommented:
dialog  --title "some title" \
        --menu "\n        Use arrows - UP/DOWN \n\
        Press [Enter] to select\n" 20 40 10 \
        "1"       "\Z2\ZZbChoose the psybnc port\Z0\ZB"\
0
rares_dumitrescuAuthor Commented:
it does not work :(
0
Duncan RoeSoftware DeveloperCommented:
OK I actually tried this one. The message colour is set by the number after the 2nd \Z- 2 for green as you originally suggested

dialog --colors --title "some title" --menu "\n        Use arrows - UP/DOWN\n       Press [Enter] to select\n" 20 40 10 "1" "\Zb\Z2Choose the psybnc port\Zn "
0
rares_dumitrescuAuthor Commented:
i dont know why, but the script does not work with --colors
the sistem is FreeBSD ..
0
Duncan RoeSoftware DeveloperCommented:
This is the Linux topic area. If you are asking a FreeBSD question, you should be up front about it.
OK get the source for Linux dialog and build it under FreeBSD. Then it will understand --colors.
URL is http://invisible-island.net/dialog/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.